[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Patch - Re-add music support for file-like objects
Maybe the test could write a sine wave to a StringIO, load it, then use
get_buffer (sound objects do have get_buffer now, right?*) to check it.
Lenard
* Sorry, I don't have access to latest Python/Pygame at the moment.
Quoting René Dudfield <renesd@xxxxxxxxx>:
> Hi,
>
> nice patch! This will be very useful :)
>
> Do you know which version of sdl_mixer allows rwops for music
> (Mix_LoadMUS_RW)? Does it require an SDL_mixer version check?
>
> Are you able to make make any unit tests for using file likes with the
> music mixer? We're using unittests for all new code now, and it'd
> make us feel more safe about adding it in for the 1.8.1 release.
>
> Not really sure how best to test it. I guess just loading the music
> from different filename, and from a python file object would be ok for
> now.
>
> here's a start on a test for it...
>
> data_fname = os.path.join('..', 'examples', 'data')
> #note, I just added house_lo.ogg to svn.
> oggfn = os.path.join(data_fname, 'house_lo.ogg')
>
> pygame.mixer.music.load(oggfn)
> pygame.mixer.music.load(open(oggfn))
> oggf = open(oggfn)
> pygame.mixer.music.load(oggf)
>
>
>
> cheers,
>
>
>
> On Sat, Jun 14, 2008 at 9:53 AM, Forrest Voight <voights@xxxxxxxxx> wrote:
> > Thanks!
> >
> > On Fri, Jun 13, 2008 at 7:31 PM, Lenard Lindstrom <len-l@xxxxxxxxx> wrote:
> >> This is interesting. I am having a look at it. No promise it can go into
> >> 1.8.1 though as this is supposed to be a bug fix.
> >>
> >> Lenard
> >>
> >>
> >> Forrest Voight wrote:
> >>>
> >>> This patch re-adds support for playing (and queueing) music from
> >>> python file-like objects.
> >>>
> >>> While support for WAV music streams is still in SDL_mixer svn, there
> >>> is support for mp3, mikmod and other formats already.
> >>>
> >>>
> >>
> >>
> >
>
--
Lenard Lindstrom
<len_l@xxxxxxxxx>