| Conforms to | |
| Framework | /System/Library/Frameworks/AVFoundation.framework/ |
| Availability | Available in iPhone OS 3.0 and later. |
| Companion guide | |
| Declared in | AVAudioSession.h |
The delegate of an AVAudioSession object must adopt the AVAudioSessionDelegate protocol. All of the methods in this protocol are optional. They allow a delegate to respond to the following sorts of changes in state:
Changes to the audio session category
Changes to the audio hardware route (such as headset plugged in or unplugged)
Changes to the availability of audio input
Changes to the number of audio hardware input or output channels
An AVAudioSession delegate can respond to interruptions at the audio session level. You can use this interface along with any iPhone OS audio technology. For example, your AVAudioSession delegate can handle interruptions for OpenAL playback.
When using the AV Foundation framework for recording or playback, you can respond to interruptions at the individual recorder or player level. To do this, create audio recorder or audio player delegates using the protocols described in AVAudioRecorderDelegate Protocol Reference and AVAudioPlayerDelegate Protocol Reference.
Called after your audio session is interrupted.
- (void)beginInterruption
AVAudioSession.hCalled after the audio session category changes.
- (void)categoryChanged:(NSString*)category
The new audio session category.
AVAudioSession.hCalled after the audio hardware input channel count changes.
- (void)currentHardwareInputNumberOfChannelsChanged:(NSInteger)numberOfChannels
The new number audio hardware input channels.
AVAudioSession.hCalled after the audio hardware output channel count changes.
- (void)currentHardwareOutputNumberOfChannelsChanged:(NSInteger)numberOfChannels
The new number of audio hardware output channels.
AVAudioSession.hCalled after the audio hardware sample rate changes.
- (void)currentHardwareSampleRateChanged:(double)sampleRate
The new audio hardware sample rate.
AVAudioSession.hCalled after your audio session interruption has ended.
- (void)endInterruption
AVAudioSession.hCalled after the availability of audio input changes on a device.
- (void)inputIsAvailableChanged:(BOOL)isInputAvailable
YES if audio input is now available, or NO if it is not.
AVAudioSession.hLast updated: 2009-11-17