User guide
iOS handles audio behavior at the app, inter-app, and device levels through audio sessions and the
AVAudioSession APIs.
Using the AVAudioSession API, you resolve questions such as:
●
Should your app’s audio be silenced by the Ring/Silent switch? Yes, if audio is not essential to your app.
An example is an app that lets users take notes in a meeting without its sound disturbing others. But a
pronouncing dictionary should ignore the Ring/Silent switch and always play—the central purpose of the
app requires sound.
●
Should music continue when your audio starts? Yes, if your app is a virtual piano that lets users play along
to songs from their music libraries. On the other hand, music should stop when your app starts if your app
plays streaming Internet radio.
Users may plug in or unplug headsets, phone calls may arrive, and alarms may sound. Indeed, the audio
environment on an iOS device is quite complex. iOS does the heavy lifting, while you employ audio session
APIs to specify configuration and to respond gracefully to system requests, using very little code.
2014-09-17 | Copyright © 2014 Apple Inc. All Rights Reserved.
6
Introduction