Instance Method

stopRecording

Tells the receiver to stop recording to the current file.

Declaration

- (void)stopRecording;

Discussion

You can call this method when they want to stop recording new samples to the current file, and do not want to continue recording to another file. If you want to switch from one file to another, you should not call this method. Instead you should simply call startRecordingToOutputFileURL:recordingDelegate: with the new file URL.

When recording is stopped either by calling this method, by changing files using startRecordingToOutputFileURL:recordingDelegate:, or because of an error, the remaining data that needs to be included to the file will be written in the background. Therefore, before using the file, you must wait until the delegate that was specified in startRecordingToOutputFileURL:recordingDelegate: is notified when all data has been written to the file using the captureOutput:didFinishRecordingToOutputFileAtURL:fromConnections:error: method.

In macOS, if this method is called within the captureOutput:didOutputSampleBuffer:fromConnection: delegate method, the last samples written to the current file are guaranteed to be those that were output immediately before those in the sample buffer passed to that method.

See Also

Starting, Stopping, Pausing, and Resuming Playback

- pauseRecording

Pauses recording to the current output file.

- resumeRecording

Resumes recording to the current output file after it was previously paused using pauseRecording.