I\'m trying to eliminate startup lag when playing a (very short -- less than 2 seconds) audio file via AVAudioPlayer on the iPhone.
First, the code:
I wrote a simple wrapper for AVAudioPlayer that provides a prepareToPlay method that actually works:
https://github.com/nicklockwood/SoundManager
It basically just scans your app for sound files, picks one and plays it at zero volume. That initialises the audio hardware and allows the next sound to play instantly.