Jake Savin

“Have no fear of perfection—you'll never reach it.” – Salvador Dalí


Fixing delay starting playback of AVAudioPlayer on iOS

Speaker_Icon.png:
Here’s a discussion on StackOverflow about how to fix the “stutter” or “slow start” playing back a sound on iOS using AVAudioPlayer:

Basically there are two recommendations – preflight the player by playing a very short “silent” sound (on another thread), or calling [audioPlayer prepareToPlay].

It seems like the main cause of the hiccough when first playing audio is firing up the audio hardware and allocating playback buffers. Apple’s documentation seems to confirm this between the lines.

See AVAudioPlayer Class Reference



Leave a Reply

Discover more from Jake Savin

Subscribe now to keep reading and get access to the full archive.

Continue reading