Page 1 of 2

Game Audio APIs

PostPosted: May 26, 2001 @ 7:19pm
by Digby
What are you guys using for audio in your games?  <br><br>I spent a little time this weekend futzing around with the waveOut APIs.  I suppose that's what you would have to use for mixing multiple wave files since DirectSound isn't available.  <br><br>Any other alternatives?<br><br>

Re: Game Audio APIs

PostPosted: May 26, 2001 @ 7:28pm
by suchiaruzu
Jaybot said he used S3M and XM or something...<br><br>[center]Hooray, Post # 500 in this Forum![/center]

Re: Game Audio APIs

PostPosted: May 26, 2001 @ 11:18pm
by Dan East
That's right, you have to use the waveOut family. It's not terribly fun programming either. If you just need rudimentary sound capability, like playing a single sample at a time, you can use the sndPlaySound function for simplicity.<br><br>Dan East

Re: Game Audio APIs

PostPosted: May 27, 2001 @ 6:50am
by Jaybot
Um, I'm just a lowly sound engineer and composer, not a programmer anymore :); but from what I've gathered from various programmers.. becuase of the obvious lack of on board sound hardware, many programmers/developers who want to use music in their games are using a MOD file decoder/player, which can cover any of the mod formats xm, s3m, it, or mod, becuase of the ability to embed the instrument samples in the file.  Some programming teams, such as brain drain (short story I don't want to tell), have asked to only write using 4 channels (which I might add, 4 channels is a total bitch btw, custom samples of different chords for same instruments.. if you know music stuff..) to leave plenty of room for SFX channels.  On the other hand, Peter Balogh has only requested that I don't exceed eight sound channels, which is fine by me (only prob is trying to keep the samples low by compression without losing sound quality, for a samller file size); I believe I read (or heard?) somewhere that the PPC has something like 16 open sound channels using a method like this, while using normal wav files for SFX.<br>Then again, Fredrik Malmer (weeboo and argentum author), is sticking to mixing only plain wav files (not PCM), a short looped wav file for music, and other wavs mixed in for SFX.<br><br>I hope that cleared something up.  If not, ignore everything I wrote above and pretend it never happened :)

Re: Game Audio APIs

PostPosted: May 27, 2001 @ 2:30pm
by Digby
Jay,<br><br>Thanks for your perspective.<br><br>You wrote:<br>>>Then again, Fredrik Malmer (weeboo and argentum author), is sticking to mixing only plain wav files (not PCM), a short looped wav file for music, and other wavs mixed in for SFX. <br><br>From all I know, plain wav files are PCM encoded, with the addition of a RIFF header.  Can you clarify a bit?  Maybe I'm missing something.<br><br>Querying the hardware in my iPaq shows that there is a single output device with only 2 channels (stereo).  If you want to play multiple sounds simultaneously, that means software mixing.  That is what I'm playing around with now.  My software must combine the PCM data from multiple buffers and then write those to the hardware using waveOutWrite.  If you have docs on these reported 16 channels of audio on a PPC, then pass them along.  I'm definitely interested.<br><br>I have no idea what XM, SM3, or MOD players are, but since the hardware can only play PCM data from a buffer, they would end up doing something similar to what I'm doing anyway.  My iPaq only seems to support uncompressed, raw PCM data so any decompression would be done in software.<br><br>Anyway, thanks for the response.  It's good to hear from people who have experience from the "content" side of the game development process.<br><br><br>

Re: Game Audio APIs

PostPosted: May 27, 2001 @ 3:20pm
by CARPEDIEM
You can add support for mod audio files with a lib called MikMod which i think you can get from http://www.xsolution-online.de/<br>the nice thing about mod files is that their file size is very small. I was going to use it in Argentum but it was kind of slow on my E-125, Jacco Bikker says it runs just fine on an Ipaq.<br>

Re: Game Audio APIs

PostPosted: May 27, 2001 @ 6:47pm
by Jaybot
The PCM thing was just something that Fredrik Mentioned in a Chat..let's see, "Fredrik Malmer: (4:26 PM) remember not to use PCM or something. Has to be plain wave<br>Fredrik Malmer: (4:26 PM) and you should run your files through this app (StripWAV), that removes stuff some codecs add"<br><br>I'm not sure if that's exactly what he meant, because he did say 'or something' maybe he can clear that up.<br><br>As for the 16 sound channels.. I'm not sure exactly where I heard that.. it's possible it might have been the sound mixing software that BD was using for G-Prime.

Re: Game Audio APIs

PostPosted: May 27, 2001 @ 9:00pm
by Digby
Carpe,<br><br>I'll check out that link - thanks.  I'm going to work strictly with PCM data though.  It's a level that I'm comfortable with.  Sounds like MOD files are similar to MIDI, in that note info is stored in the file and the library has the PCM data (or whatever it takes) to play.<br><br>Jay,<br><br>Perhaps he made a slip and really meant ADPCM?  I might investigate using simple compression on the wav data, by encoding relative sample position rather than absolutes, then quantizing these steps using a 16-entry lookup table.  I think I could decode this pretty quickly when the hardware buffer is loaded, but if it's slow I'm going to dump it.<br><br>

Re: Game Audio APIs

PostPosted: May 28, 2001 @ 4:38am
by Malmer
Yes, I ment ADPCM...sorry for the confusion...As for "stripwav" it is a utility that removes the extra stuff some codecs add to the wave file, such as icons and descriptions. The wave-file reader is based on sourcecode from microsoft, and somehow it doesn't support that stuff in the wave file. The fun part is that Microsoft Codecs add the extra stuff!<br><br>// Fredrik<br>

Re: Game Audio APIs

PostPosted: May 28, 2001 @ 12:04pm
by Digby
From what I gather about ADPCM, the "extra stuff" in the encoded wav file include the coefficients necessary to describe the base waveform for the adaptive compression.  <br><br>I'm not really clear on why you would have extra info for a normal run-of-the-mill PCM-encoded wav file.  Perhaps some audio tools allow you to add composer information or some such?<br>

Re: Game Audio APIs

PostPosted: May 28, 2001 @ 1:24pm
by Malmer
A normal plain PCM file COULD contain stuff like a special icon for the wave file and who the author is, a describtion etc...<br><br>// Fredrik

Re: Game Audio APIs

PostPosted: May 30, 2001 @ 10:13am
by Phantom
Hey,<br><br>MikMod is indeed for playing sound and music. If you want to use it, keep in mind the following:<br>1. Use .MOD files. Those are only 4 channels, wich saves a lot of mixing.<br>2. Alter the MikMod sources; take out the volume stuff. This saves a multiply for every sample in every channel, this reduced the processor load of MikMod to less than 10% when running at 30fps on my iPaq (wich still means that an E-125 game running at 100 fps would spend almost all it's time in MikMod...)<br><br>But, it saves you a lot of hassle. And it sounds great.<br><br>- Jacco.

Re: Game Audio APIs

PostPosted: May 30, 2001 @ 12:11pm
by Moose or Chuck

Re: Game Audio APIs

PostPosted: May 30, 2001 @ 12:56pm
by Diego Cueva

Re: Game Audio APIs

PostPosted: May 30, 2001 @ 9:40pm
by Jaybot