So if you’re an old school Mac programmer, you’re probably vaguely aware that OpenAL is a fully Apple-supported API on the iPhone as well as desktop OS X these days, but haven’t looked into it all that much yet … hey, there’s all that CoreAudio code of yours sitting around that works fine, right? Well, yes, but there are good cross-platform reasons, particularly if you’re into that gaming thing and have a use for multitrack positional audio, to get familiar with it. The canonical destination is the above linked home, but here’s some iPhone-specific links of interest:
iPhone Programming Part 6: Multiple Sounds with OpenAL
This provides a handy-dandy Cocoa singleton wrapper class for your OpenAL management.
iPhone, OpenAL, and IMA4/ADPCM
How to decompress IMA4 audio files and pass them to OpenAL for playback. Smaller is always better!
Never overlook the technical notes! It’s always worthwhile doing a full text search for those to catch stuff that isn’t in the formal documentation for a given API. As well, don’t miss the various Apple-blessed OpenAL sample code:
Basic example showing OpenAL usage in a 2D OpenGL environment. This sample demonstrates how to bind OpenAL sources to OpenGL objects to create an audio environment.
The code uses OpenAL to play a single audio source. Move source or listener position by dragging icons around on the grid. Turn accelerometer functionality on to set listener orientation by tilting the device.
Anything else to add to this list, Dear Readers?
Continue Reading →APR