Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question focuses on the API's available on phones.

I'd been planning to use OpenAL in my game for maximum portability. It runs great on Linux so I can quickly iterate while developing as well as leverage the desktop's superior debugging tools.

However I've recently heard that Android doesn't support OpenAL well. Instead they've gone with an OpenSL ES library.

What I'm looking for is a free Audio library that I can use with minimal custom code on iPhone, Android, and my Linux desktop. Does such a library exists?

Some extra details:
The game is written in C++ with custom minimal front ends, e.g. ObjC for iPhone, Java for Android, and SFML for desktops. I'm using OpenGL ES for portability as iPhone doesn't support the more advanced OpenGL APIs.

share|improve this question
Would such library be in C++ then? – The Communist Duck Mar 3 '11 at 16:55
I should be C++ compatible, e.g. C, C++, assembly, etc. Honestly I don't know of any other language that is compatible with desktops, Android, and iPhone. – deft_code Mar 3 '11 at 17:47
up vote 4 down vote accepted

I find OpenAL pretty convoluted for small things. What are your feature requirements? Because mine are pretty simple:

  • load/close samples and music
  • play/pause/stop music
  • play samples
  • dynamically change per-channel volume for each item being played

If your requirements are that simple, too, I suggest you consider sticking with whatever’s more convenient on the platform, at the cost of a few #ifdef’s. I usually use SDL_mixer (despite its numerous shortcomings) on desktop systems, and the OS audio layer on mobile platforms.

You should have a look at ALmixer, which is basically SDL_mixer done right on top of OpenAL.

share|improve this answer

You might want to check out fmod.

share|improve this answer

I have found it easier myself to put the playing of audio in the platform-specific code rather than trying to use a works-portably library to wrap it.

The discussion then comes what format to use. MP3 works well everywhere.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.