Playing sounds using Apple’s AVAudioPlayer is pretty simple, and there is quite a bit of instruciton on how to do that.
OpenAL is another story as most of the documentation and wrappers come from other platforms, and while there are a few libraries out there that wrap OpenAL commands into an easier to use library I’ve found a new one that I really like.
The librar is from Karl Stenerud and is known as Object-AL-for-iPhone. What’s great about it is that he’s included some terrific demos so you can easily figure out how to do things such as pan multiple sounds, and change pitch with ease (see the picture above for the list of demos included).
The syntax is great, and changing the position of a sound source is an absolute breeze. Karl has done a great job of documenting things and there is even a PDF file included with the Github project that lets you step right in and use it. It’s very simple to just take the library, drop it into your project and get started.
Check out the github project here:
ObjectAL on Github
Btw, if you’ve created an open source library and need some exposure submit information about it here and I’ll be glad to check it out, and put it in front of the 2,000+ daily visitors to this site.
Handling OpenAL can be a difficult task for some iPhone programmers, and it’s understandable since using OpenAL requires a knowledge of C that new iPhone programmers typically don’t have. Fortunately, an excellent and free solution has been provided.
The solution is from 71 Squared, and they’ve had a sound manager class included among their game programming tutorials for quite some time. The original had a few hiccups, but I’m playing around with the new one right now, and it looks like they fixed things up.
Some cool functionality has been added for playlists, and all memory leaks are gone, you’ll love this thing it’s easy to use. You can download the updated version here: Latest Sound Manager Class
The original tutorial and video for the sound manager can be found here: iPhone Game Programming Tutorial 9
Thanks again to 71 Squared, and I can’t wait for their book to come out.