Instance Method

recordForDuration:

Records for a specified duration of time.

Declaration

- (BOOL)recordForDuration:(NSTimeInterval)duration;

Parameters

duration

The maximum duration, in seconds, for the recording.

Return Value

YES if successful, otherwise NO.

Discussion

The recorder stops when the duration of recorded audio reaches the value in the duration parameter.

Calling this method implicitly calls prepareToRecord, which creates (or erases) an audio file and prepares the system for recording.

See Also

Configuring and Controlling Recording

- prepareToRecord

Creates an audio file and prepares the system for recording.

- record

Starts or resumes recording.

- recordAtTime:

Starts recording at a specific time.

- recordAtTime:forDuration:

Starts recording at a specified time for a specified duration of time.

- pause

Pauses a recording.

- stop

Stops recording and closes the audio file.

delegate

The delegate object for the audio recorder.

AVAudioRecorderDelegate

The delegate of an audio recorder object.

- deleteRecording

Deletes a recorded audio file.