[SDL] Re: SDL_Mixer sound effect problem causing my game to stutter

Alex Volkov avcp-sdlmail at usa.net
Mon Nov 7 15:58:21 PST 2005

James OMeara wrote:
> Damn, so I've done nothing wrong with that code?
> I already open my audio like this:
> Mix_OpenAudio(44100, AUDIO_S16SYS, 2, 2048)

I dont know if you've done anything wrong, but I would not load the sfx that
Loading the wave files in the middle of the real-time game is a bad idea and
I would not be surprised if that was the problem here. Preload all the waves
and stash them away in your definition structs.

> Is there a possibility that my wav file could be behind this? I've got my
> file set up as a mono 44KHz, 8 bit file, with PCM encoding.

The format difference could be the ultimate catalyst -- the straw that
breaks the camel's back, since CPU time is needed to convert the chunk to
the sound buffer format.


More information about the SDL mailing list