RE: [GD-General] Writing an audio mixer
Brought to you by:
vexxed72
From: Brian S. <bs...@mi...> - 2002-03-18 19:29:52
|
Threaded is easier than non-threaded? Ha! No, I think the advantage is that a non-threaded architecture is more = portable (as Brian Hook has already mentioned, old Mac OS doesn't have = preemptive threading, and older consoles didn't either) and it's more = efficient not to have a separate thread if you can run your main loop = fast enough to service the sound buffers. Threaded is easier if you're a company like RAD selling a sound engine, = because you can guarantee good performance and you don't have to field a = bunch of calls from people with games running at 15 fps complaining that = their sound is dropping out. As for SMP, well, about 0.00001% of gamers are going to have 2 or more = processors ;) --brian -----Original Message----- From: Mads Bondo Dydensborg [mailto:ma...@ch...]=20 Sent: Saturday, March 16, 2002 2:39 AM To: Ignacio Casta=F1o Cc: gam...@li... Subject: Re: [GD-General] Writing an audio mixer On Sat, 16 Mar 2002, Ignacio Casta=F1o wrote: > Hi, > I will be writting sound mixer next week, and I have to admit that I=20 > have no idea of sound programming. I could use sdl or any other=20 > library, but i just want to do that myself to learn how it's done.=20 > I've been looking for info about sound programming witout much look,=20 > I've only found low level details about the sound blaster :-( So if=20 > somebody knows where to find a good tutorial about this, I would=20 > really appreciate it. I do not know about tutorials, but I wrote my own mixer once in about = 1000 lines of code. It used a seperate thread, because I thought that to = be easier. The problem with my code was that I could only support mone 8 = bit samples. This is easy to do. When you want to support stereo, or = even more channels, and formats where the byte order is important (e.g. = 16 bit samples), it begins to suck. Also, you need to support a number = of different interfaces if you wish your code to work across platforms. > Anyway, I just can learn that by reading source code, for example,=20 > quake's sound engine runs on every game update, while sdl's and=20 > minifmod's run in a different thread. Updating the audio in the game=20 > loop seems to be easier to me, at least i have to write less platform=20 > independant code, but it seems that you have that work already done.=20 > On the other hand threaded audio seems to be the right thing, since=20 > most libraries do that. Threaded is easier. For _ultimate_ performance, you want to schedule = yourself, in this case from the game loop. But, seriously, who needs that? Carmack might, because he writes to = highend metal, but the rest of us? You loose SMP benefits, etc. YMMV. Mads --=20 Mads Bondo Dydensborg. = ma...@ch... I disapprove of what you say, but I will defend to the death your right = to say it. - Beatrice Hall [pseudonym: S.G. Tallentyre], 1907 (many times = wrongfully attributed to Voltaire) _______________________________________________ Gamedevlists-general mailing list = Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-general Archives: http://sourceforge.net/mailarchive/forum.php?forum_idU7 |