View Full Version : Audio library suggestions
damocles
01-18-2004, 05:17 AM
I was wondering what everyone is using for their audio systems. Do you program your own by hand or use a prebuilt library. If so, which library?
I used FMOD which is brilliant, but annoying that you have to pay the license fees for every title when there are probably other license free options available.
In my searches I have found a few options, but mostly they either suffer from poor performance/features or terrible documentation. So what's everyone using and what would you recommend?
Kai-Peter
01-18-2004, 05:51 AM
FMOD here as well. You can buy a shareware site license for $250 (or a single product lisence for $100). Just check out their page ..
luggage
01-18-2004, 06:10 AM
We use Audiere and play oggs. Was easy to implement and free for commercial use. http://audiere.sourceforge.net/
damocles
01-18-2004, 06:34 AM
Yeah I've seen Audiere before - the engine looks fine, but the documentation seems haphazard. It just looks like a dump of a function reference mixed in with class heirarchy diagrams. Do you know of any other documentation for it, or will I just have to trudge through the docs and try and find the starting point?
Larry Hastings
01-18-2004, 06:45 AM
BASS (http://www.un4seen.com/bass.html) and FMOD (http://www.fmod.org/) are from my perspective about the same. They're about the same size (100k for BASS, 150k for FMOD), they both offer all the features I would ever need, and for shareware developers they are about the same price ($120 for BASS, $100 for FMOD if you meet their shareware criteria). Of the two, I'm using BASS, but you might choose differently.
The bad: I've had crashing problems with BASS in the past (though not in my game--it was in Mr. Boeh's Z-Ball), and a 100% CPU utilization problem (that one was in my game), and there are nebulous FUD-dish rumors about BASS being unstable.
The good: I went with BASS over FMOD for one specific reason. Both libraries support a proprietary form of compressed MOD files. However, FMOD's support (OggMOD) supports only XM files, and has a seriously confusing and unproductive interface. BASS's support (MO3) supports any MOD filetype supported by BASS (which is a lot), and has only a mildly confusing (but much more productive!) interface. The resulting files are small and sound great, which means I can ship lots more music in my game without the installer ballooning up.
Apart from that one crucial feature, I would honestly have preferred to go with FMOD. Why? BASS is only available for Windows. FMOD was written on Windows, but now has been ported to Windows CE, XBox, Linux, Macintosh, GameCube, and even the PS2. No, I'm not planning on porting to any of those environments. But my gut feeling is that porting software exposes bugs and knocks off sharp edges. BASS's software monoculture is a weakness, not a strength.
Don't get me wrong--BASS is lovely, and does everything I need, and the only problem I've had with it was fixed promptly and to my satisfaction by the author. I'm happy with it and have no intention of switching. But if it weren't for those lovely MO3 files, I expect I'd be using FMOD.
Hope that helps.
damocles
01-18-2004, 06:54 AM
The good: I went with BASS over FMOD for one specific reason. Both libraries support a proprietary form of compressed MOD files. However, FMOD's support (OggMOD) supports only XM files, and has a seriously confusing and unproductive interface. BASS's support (MO3) supports any MOD filetype supported by BASS (which is a lot), and has only a mildly confusing (but much more productive!) interface
I never experienced this at all. I've developed sound systems in both FMOD and BASS. I found both APIs easy to use and lean towards FMOD for ease of use (but I guess that's a personal preference). As for MOD playback - FMOD supports S3M/MOD/XM and IT. Those are the main formats in use, and if you wanted to, you could use ModPlug to convert to any of those formats from an enormous list of other mod types. IT mods are clearly the best mod format anyway (most features/flexibility).
And as you said FMOD is more stable and faster. When I developed a sound system in BASS I had to use the BASS forums three times to get past memory problems that were causing leaks and in one case a serious crash. In FMOD I developed a working, bug free sound system in 30 minutes (both mod music playing and wav playing). FMOD is the best sound system out there, I just figure there's got to be a suitable replacement that won't cost $100 per title.
Jake Stine
01-18-2004, 08:54 AM
It's pretty much a rule of thumb that what you are actually paying for on libs like FMOD is the support and documentation more than anything, and so if you want good documentation you better be prepared to fork over the $$.
In all my years of working on Mikmod, by far the most difficult part was writing docs. In fact, writing docs (particuarly docs that don't suck) is so hard for me to do that I tend to just code Mikmod into peoples' projects for them so that I didn't have to actually write down how to do it. :) And then I just set up a few examples in the code to illustrate how they can do most of the common game-style features (crossfading songs, fine control of wav/ogg playback, etc).
I can't very well charge money for something that isn't documented, and I can't very well give a personal tutorial session to everyone out there on how to use it. Instead, I've been known to hand my bastardized version of Mikmod out on a per-request basis... mostly to casual hobbiests who don't feel the pressured sting of needing a sound lib with good, reliable, garaunteed support and who don't mind digging around in the header files and browse info a bit to find some of the more advanced features/toys.
luggage
01-18-2004, 09:17 AM
Regarding audiere and it's api. I didn't really consult it to be honest. I just took the sample code and used that. All I needed was playing a sfx, playing it looped, adjusting the volume and playing a streamed music track. It is literally 3 lines of code to load and play a sound. If you need any help or a bit of source code just give me a shout.
damocles
01-18-2004, 10:26 AM
Aha, I just found the tutorial.txt file that has a few basic lines to get you started (before I had only seen the html docs that just list various functions and classes). I think I'll have a bash at audiere then and see how it works out - thanks.
An interesting note about BASS stability: I remember reading in the BASS forums maybe 2-3 years ago about PopCap buying a license for BASS, but ditching it in favor of FMOD due to stability issus with BASS. Now, fast forward in time: PopCap's most recent game uses BASS, ... it seems things have improved.
My experience with BASS/FMOD (from a few years ago) is while I do remember liking the BASS API more, I had lock-up/crash problem with it. The FMOD API was not as clean/uniform, but it ran with out any crashes. I did come across a few minor bugs in FMOD during my in-depth testing of it, but no show-stoppers.
BTW, Any body have any experience with OpenAL (www.openal.org)?
I have only taken a cursory look at it but it seems very interesting: it's been around a number of years, is free, is cross-platform and has been used in several commercial and indie developed games.
David
princec
01-19-2004, 12:27 AM
I've got a fair bit of experience with OpenAL. Free, crossplatform, wonderful API, but geared solely towards sound rendering, not the utilities like decoding OGGs (although that's coming shortly) or playing music or sequencing. There are also problems with OSX 10.3.2 which I've just come across in the current version - crashes in the mixer.
Cas :)
patrox
01-19-2004, 01:15 AM
You might want to look into KSound, it's very basic but at least you don't pay for what you don't use ;) ( no 3d sound nor fancy things, a simple sound engine for 2d games )
http://www.phelios.com/ptk/
pat.
ggambett
01-19-2004, 06:58 AM
I use SDL_Mixer, it's simple but it does what we need (load and play simple oggs/wavs). Free, open, portable.
Hercule
01-19-2004, 09:34 AM
OpenAL is very easy to use. I used Fmod but openAL do the job, and it's free.
xfire
01-19-2004, 10:24 AM
Hi Folks,
i play oggs using direct sound.
Just my two cents...
I use SDL_Mixer too. Very simple API, plays OGG fine; but XMs are not perfectly played it seems (not the one(s) I tried at least).
MiceHead
01-19-2004, 06:01 PM
I'm a BASS man.
FMOD was great -- I prefer the way it handles audio streams to BASS's approach; and it possesses more features than BASS. But the license is just too expensive for me. $2,000 per title, (there is a $100 license, but it is restrictive).
FWIW, I've used BASS for years, and have never had stability problems.
damocles
01-20-2004, 03:38 AM
In what way do you find the $100 FMOD license restrictive?
MiceHead
01-20-2004, 01:13 PM
I'd say this is my biggest sticking point:
The licensee must be an individual/hobbyist and not a registered business or company with more than 1 employee or director
Perhaps I'm misreading this, but it seems that if you have two people working on your project, you do not qualify for the shareware license(?)
damocles
01-20-2004, 01:39 PM
There is that. Although there are loop holes - there's no reason you would need to register yourself/your team as business. And you could just make it a solo business but have a personal contract drawn up agreeing to pay X percentage of you earnings from it to a "friend".
But yeah, I guess it's a pain to go through all that. Another reason why I'm looking around the audio libs then :)
Diodor
01-22-2004, 08:31 PM
What are the downsides of simply using the Windows SDK function PlaySound?
PlaySound doesn't do any mixing. Also, no support for music file formats like MODs or Ogg or Mp3 or anything... Yes, you can code your own mixer and/or loader->converter for the PlaySound API but that is an awful lot of work.
I earlier said that I had problems playing XMs with SDL_Mixer. In fact it looks like it was caused by a too small buffer. I was using 1024, and 2048 seems to fix the problem (and also fix the ogg playing on my musician's -more powerful- computer). Yeepee :-).
The only problem with increasing the buffer is that the sound effects are delayed, but with 2048 I think that it's only a 0.05 s delay (or at worst 0.1 s), so it's ok.