[GD-General] Writing an audio mixer
Brought to you by:
vexxed72
From: Brian H. <bri...@py...> - 2002-03-15 20:17:51
|
During the lull between Candy Cruncher and our next product I'd like to take a day and write our own audio mixer to minimize our dependencies on per-platform audio mixing capabilities. We can survive without hardware mixing (in fact, we don't support it right now at all because it's so damn flaky). I've never done an audio mixer before, but I understand the general theory of audio mixing. Anyone have any pointers, tips, gotchas before I dive into it? The overall architecture I envision is that the app will queue up sounds that will be told to play by our sound manager object. At regular intervals the sound manager is told to mix the currently active audio into a buffer that gets dumped to whatever output device we have. I already have a good chunk of this in place because that's how our streaming audio works -- in fact, it would be relatively trivial for me to just have the streaming audio thread mix in external sound buffers. The only bit I'm concerned about is servicing the audio via a thread vs. servicing the audio during game updates. A separate thread (or interrupt on MacOS....God, will that operating system PLEASE die?!) at least prevents me from having the audio puke on a long file load. Brian |