On, Tue Feb 19, 2008, Alistair Buxton wrote: > Thanks for the quick reply. > > I was confused because SDL_InitAudio directly returns the actual > format through a pointer, while SDL_mixer uses a separate function > Mix_QuerySpec which I didn't notice. > > On 19/02/2008, Marcus von Appen <mva@xxxxxxxxxxxx> wrote: > > > > Also it would be nice to have a pygame.mixer.Sound.from_buffer() > > > function similar to the Surface.from_buffer() in that it does not > > > require Numeric. I don't have anything against sndarray and surfarray > > > > True. I'll put it onto my TODO list. > > How long is your TODO list? I might take a shot at it myself since I > have svn set up already but if I don't post a patch within a couple of > days it probably means I've given up... I'm an oblivious idiot :-). A buffer method's already available in the current SVN tree. You can use pygame.Sound (your_buffer) safely, the buffer just has to match the mixer criteria. Due to the SDL_Mixer implementation however, the buffer will be copied, so a manipulation of the buffer object after creating the Sound will not have any impact on it. Regards Marcus
Attachment:
pgpkWqIQcgFPH.pgp
Description: PGP signature