Question

I write an Desktop/iOS Game with OpenGL and want to play audio files (mp3 or wav). I've worked already with CoreAudio and AudioQueues, but now I need something that works also with Windows (and maybe Linux).

I've seen so far:

  • OpenAL
  • OpenSL

I only need really basic features - like "playSound(file)" and "isPlaying(file)" - no 3D Sound, effects and so on... OpenAL & OpenSL are both from khronos - so I dont really get the difference (yes, they are 2 different librarys thought).

What would be the simplest cross-plattform soultion? Can I write with one of them code, that runs on iPhone and Desktop PCs similiar?

Was it helpful?

Solution

If your target platforms are Windows/Mac/iOS then OpenAL is a fine choice as it's supported on all those platforms. The place where you will need to write cross platform code is how you open and decode your files.

OTHER TIPS

You might be looking for SDL_audio, which loads an audio file and plays it. Its' API is available in C, and it is cross-platform.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top