Reputation: 8961
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:
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?
Upvotes: 4
Views: 7076
Reputation: 1149
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.
Upvotes: 0
Reputation: 1143
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.
Upvotes: 3