[SDL] Re: SDL_Mixer sound effect problem causing my game to stutter
james at nformant.net
Tue Nov 8 23:55:53 PST 2005
Alex Volkov <avcp-sdlmail <at> usa.net> writes:
> You said you are using an 8bit PCM coding, so I am assuming it's actually a
> u-Law or a-Law coding (not plain PCM). That could make a difference as it
> takes time to decode. However, if you really are using 8bit unsigned PCM,
> I'd suggest a 22KHz 16bit rather -- you'll get better quality with that.
Well, to tell you honestly, I have no idea about all the real tech stuff. Some
of my effects were recorded using Sound Recorder in Windows. I selected
Format>PCM and Attributes>44,100 8Bit Mono
I can easily re-record the files, so what will I get the best performance out
of? 22Khz, or 44.1Khz at 8 or 16 bit if I do this: Mix_OpenAudio(44100,
AUDIO_S16SYS, 2, 2048)
I'd imagine I'd get the best performance with the 44.1KHz, 16-bit wav files.
Is this a bad question? I try to keep my head out of stuff like this, and I
really shouldn't, but it leaves me unaware of how to do things properly.
Also, you said: "Preload all the waves
and stash them away in your definition structs."
How would I go about doing something like this? I was thinking about doing
something like making a vector of Mix_Chunk's, and then having a function that
manually loaded each file into the vector.
Can you suggest something that will work better?
Again, thanks for all the help.
More information about the SDL