Protocol: AVAudioRecorderDelegate
Overview
The delegate of an AVAudioRecorder object must adopt the AVAudioRecorderDelegate protocol. All of the methods in this protocol are optional. They allow a delegate to respond to audio interruptions and audio decoding errors, and to the completion of a recording.Called when the audio session is interrupted during a recording, such as by an incoming phone call.Called by the system when a recording is stopped or has finished due to reaching its time limit.Called when an audio recorder encounters an encoding error during recording.Called after your audio session interruption ends, with options indicating the state of the audio session.
Instance Method Summary (collapse)
-
- audioRecorderBeginInterruption:
Called when the audio session is interrupted during a recording, such as by an incoming phone call.
-
- audioRecorderDidFinishRecording:successfully:
Called by the system when a recording is stopped or has finished due to reaching its time limit.
-
- audioRecorderEncodeErrorDidOccur:error:
Called when an audio recorder encounters an encoding error during recording.
-
- audioRecorderEndInterruption:withOptions:
Called after your audio session interruption ends, with options indicating the state of the audio session.
Instance Method Details
- (Object) audioRecorderBeginInterruption(recorder)
Called when the audio session is interrupted during a recording, such as by an incoming phone call. Upon interruption, your application’s audio session is deactivated and the audio recorder pauses. You cannot use the audio recorder again until you receive a notification that the interruption has ended.
- (Object) audioRecorderDidFinishRecording(recorder, successfully:flag)
Called by the system when a recording is stopped or has finished due to reaching its time limit. This method is not called by the system if the audio recorder stopped due to an interruption.
- (Object) audioRecorderEncodeErrorDidOccur(recorder, error:error)
Called when an audio recorder encounters an encoding error during recording.
- (Object) audioRecorderEndInterruption(recorder, withOptions:flags)
Called after your audio session interruption ends, with options indicating the state of the audio session. For an audio recorder’s delegate to receive this message, the audio recorder must have been recording when the interruption started. When an interruption ends, such as by a user ignoring an incoming phone call, the audio session for your application is automatically reactivated; at that point you can again interact with the audio recorder. To resume recording, call the record method.If this delegate method receives the AVAudioSessionInterruptionOptionShouldResume constant in its flags parameter, the audio session is immediately ready to be used.