I'm currently looking into adding sound to my game. I have seen OpenAL and SDL, but I would like to know what else is out there. Can you recommend any good cross-platform Audio APIs for game development?
Stack Overflow question: "Cross platform sound API for games?"
I agree with the accepted answer:
I'm a big fan of SFML Library. It does provide additional Graphic and Network features, but what is relevant to this question, is that it also has neat Audio package.
Audio features are:
- Uses hardware acceleration whenever possible
- Can load and save standard sound formats : ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam, w64, mat4, mat5 pvf, htk, sds, avr, sd2, caf, wve, mpc2k, rf64
- Can load all audio resources directly from files in memory
- 3D sound spacialization
- Easy interface for capturing audio
- Manages memory efficiently, so that you don't have to worry about resources lifetime or storage
- Supports streaming for big files ; you can even write your custom streaming class for any source (network, ...)
- Supports multi-channels formats (mono, stereo, 4.0, 5.1, 6.1, 7.1)
The sort of de-facto API for sound implementation in games these days as far as I'm concerned is FMOD.
It's free for non-commericial uses, and relatively inexpensive for "casual" (read: indie) development.
It is a bit overkill for the simple "play back this sound" requirement, but does provide a huge feature set that's well tested on all sorts of platforms.
I really like OpenAL as a cross-platform audio library. The API is a bit low level but you can easily wrap it into a nicer engine friendly interface. It's truly cross platform with first class support for: iPhone, Android, MacOSX, Windows, and Linux.
Take a look at Djinn Engine sound code. Two files, maybe 300 lines between them (counting comments etc) and you'vd got a workable sound system.
I've never build an audio centric game, so OpenAL might not fit the bill if extreme control is needed.
Additionally to FMOD, there is Audiokinetic Wwise, which is more and more used in the game industry as a professional cross-platform sound design tool and API. It has a large selection of effects (including convolution reverb), complex sound logic system, sound layering, profiling, interactive music tools, etc... It provides a good selection of decoding algorithms and is also free for non-commercial projects.