[SDL] SDL_mixer questions

John Philip phip at spymac.com
Tue Aug 24 22:54:48 PDT 2004


I have a number of questions about using SDL_mixer, if anyone has time:

If you are creating custom Mix_Chunk from a buffer using Mix_QuickLoad_RAW((), what sizes can the buffer be? Should I just 
pick ((samplerate * channels * samplesize * 1000) / n) to create a Mix_Chunk n milliseconds long, or need it align along 
some other boundaries as well?

What happens when I call Mix_PlayChannel() to play another Mix_Chunk while one is still playing on that channel? Is the 
older chunk dropped? Is the new chunk dropped? Is the new one queued to play after the old one finishes?

Last, does this sound problem ring a bell to anyone?
Another computer on my LAN sends me about 1000 bytes per packet of a 25 second AIFF file on loop. Mix_QuickLoad_Raw() 
creates a Mix_Chunk with a packet's data, Mix_PlayChannel() plays it on a fixed channel, and then I wait for the next packet. 
The AIFF file is the same format as SDL_mixer was started (22050 Hz, Mono, AUDIO_S16SYS)
The resulting sound is still similar to the original, but must faster and more distorted.

Thanks,
John
---- Introducing Spymac MailPro: http://www.spymac.com/mailpro/




More information about the SDL mailing list