I want to know if it's possible to play Ogg Vorbis audio file with iPhone SDK or if exist a library or a framework that allow this.
I've read something about OpenAL but I don't find any tutorial... Can anyone help me??
I want to know if it's possible to play Ogg Vorbis audio file with iPhone SDK or if exist a library or a framework that allow this.
I've read something about OpenAL but I don't find any tutorial... Can anyone help me??
Cricket Audio will play ogg files, among others, and works on iOS/Android/WP8.
Better late than never ;)
I have found the answer here Use cocos2d for playing ogg file in my project?.
They mentioned PASoundMgr. It worked for me. I just copied from cocos2d framework all files->libraries that SoundEngineTest was based on. And got rid of unnecessary code.
Here is my demoProject that shows how to play ogg on ios.
Be careful with iOS 5.* simulators, they have some problems with sound library. My demo works on 4.3 simulator and on Device.
Here are steps that I made to create demo:
First you will need cocos2d-iphone framework. I've already had it, but you can find it here cocos-2d_download.
As you can notice SoundEngineTest depends on libvorbis.a. It's a library that made of files from
external/Tremor
group. Also it depends on OpenAl, AudioToolbox frameworks.I copied all files from tremor group to my project. Crearted "vorbis" Cocoa Touch Static Library, without ARC. And added all source files and header to the "vorbis" target in Build Phases tab.
In the Build Phases of OggPlayDemo Added libraries (libvorbis, OpenAl, AudioToolbox) to the Link Binary with Libraries box.
Added PA classes to project. And checked OggPlayDemo as a target. To avoid problems with ARC, I disabled ARC compilation for this 3 PA files. (see disable ARC for single file)
Removed all cocos2d references. There were some code related to correcting position of listener depending on orientation... I commented it. I don't need this feature for just playing audio.
Copied audio file.
And finally added this code to ViewController: