Delays

The first time you play back a system sound on iOS, you might encounter delays. You may want to play a silent sound on application initialization to avoid a delay on subsequent playback.

Note

When testing on iPhones, make sure you have not enabled the silent ringer switch on the left side of the unit. Audio Services alerts do not play when that switch is enabled. This oversight has tripped up many iPhone developers. If your alert sounds must always play, consider using the AVAudioPlayer class.

Get The Core iOS Developer’s Cookbook, Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.