I would like to do this very simple thing: playing PCM audio data from memory.
The audio samples will come from sound-synthesis algorithms, pre-loaded sample files or whatever. My question is really about how to play the buffers, not how to fill them with data.
So I'm looking for the best way to re-implement my old, deprecated AudioWrapper (which was based on AudioUnits V1), but I could not find in the Apple Documentation an API that would fulfill the following:
- Compatible with 10.5 through 10.7.
- Available in ios.
- Does not rely on a third-party library.
- Be future proof (for example: not based on Carbon, 64 bits...).
I'm considering using OpenAL, but is it really the best option ? I've seen negative opinions about it, it might be too complex and overkill, and might add performance overhead ?
At worse, I could have two different implementations of that AudioWrapper, but if possible, I'd really like to avoid having one version for each system (ios, 10.5, 10.6, 10.7...). Also, it will be in C++.
EDIT: I need a good latency, the system must respond to user interactions in under 20 ms (the buffers must be between 128 and 512 samples at 44KHz)