Re: [GD-General] Writing an audio mixer
Brought to you by:
vexxed72
From: <cas...@ya...> - 2002-03-16 04:09:23
|
Hi, I will be writting sound mixer next week, and I have to admit that I have no idea of sound programming. I could use sdl or any other library, but i just want to do that myself to learn how it's done. I've been looking for info about sound programming witout much look, I've only found low level details about the sound blaster :-( So if somebody knows where to find a good tutorial about this, I would really appreciate it. Anyway, I just can learn that by reading source code, for example, quake's sound engine runs on every game update, while sdl's and minifmod's run in a different thread. Updating the audio in the game loop seems to be easier to me, at least i have to write less platform independant code, but it seems that you have that work already done. On the other hand threaded audio seems to be the right thing, since most libraries do that. Ignacio Castaño ca...@as... Brian Hook wrote: > 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 _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com |