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

David Olofson david at olofson.net
Tue Nov 8 02:41:50 PST 2005


On Tuesday 08 November 2005 09.27, James OMeara wrote:
[...]
> I'm a bit worried about the number of effects I'd have to load,
> however. I'd end up having to load 50 or so sound effects, and I'm
> sure that would take up a bit of memory.

Assuming you're aiming at low end systems and/or want a handy, 
comfortable download size, or you want lots of high quality sound 
effects, that could be a problem...

The download size can be dealt with by using Ogg Vorbis or something 
for the sound effects, or taking it to extremes and use a custom 
structured audio engine. (The latter can be extremely effective, but 
creating structured audio is a completely different process, compared 
to samples.) However, if you need to run on systems with very little 
RAM, you'll probably also have to deal with CPUs that are too slow to 
decode or render sounds in real time. You can still shrink the 
download by decoding/rendering in the installer or when loading 
levels, or even let the user decide.

A slightly different approach is to make the most of a smaller set of 
waveforms by means of simple real time effects, like changing the 
pitch, looping, "coarse" granular syntesis (playing lots of short 
sounds with varying volume and pitch), simple filters (a 12 dB/oct 
resonant SVR, for example), feedback delays, waveshapers, 
compressors... I think you can do at least some of this with 
SDL_Mixer (fx plugins), so you shouldn't need to roll your own sound 
engine, unless you're going for really advanced stuff.


//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
|  Free/Open Source audio engine for games and multimedia.  |
| MIDI, modular synthesis, real time effects, scripting,... |
`-----------------------------------> http://audiality.org -'
   --- http://olofson.net --- http://www.reologica.se ---




More information about the SDL mailing list