You tell iOS your application’s audio intentions by designating a category for your audio session. Table A-1 provides details on each of the categories. The default category, kAudioSessionCategory_SoloAmbientSound
, is shaded. For an explanation of how categories work, see “Choosing the Best Category.” For an explanation of the mixing override switch, see “Fine-Tuning the Category.”
Category identifiers* | Silenced by the Ring/Silent switch and by screen locking | Allows audio from other applications | Allows audio input (recording) and output (playback) |
---|---|---|---|
| Yes | Yes | Output only |
| Yes | No | Output only |
| No | No by default; yes by using override switch | Output only |
| No (recording continues with the screen locked) | No | Input only |
| No | No by default; yes by using override switch | Input and output |
| – | No | No input and no output |
*In each row, the first identifier is for the Objective-C-based AVAudioSession
interface; the second identifier is for the C-based Audio Session Services interface.
Notes: Versions of iOS earlier than iOS 2.2 did not include the kAudioSessionCategory_SoloAmbientSound
category and instead used the kAudioSessionCategory_MediaPlayback
category as the default. Two deprecated categories are not shown in the table: The deprecated kAudioSessionCategory_UserInterfaceSoundEffects
category is equivalent to AVAudioSessionCategoryAmbient
; the deprecated kAudioSessionCategory_LiveAudio
category is equivalent to AVAudioSessionCategoryPlayback
.
Last updated: 2010-07-09