A capture output that records audio and saves the recorded audio to a file.


class AVCaptureAudioFileOutput : AVCaptureFileOutput


AVCaptureAudioFileOutput implements the complete file recording interface declared by AVCaptureFileOutput for writing media data to audio files. In addition, you can configure options specific to the audio file formats, including writing metadata collections to each file and specifying audio encoding options. AVCaptureAudioFileOutput does not, however, support startRecording(to:recordingDelegate:)—use startRecording(to:outputFileType:recordingDelegate:) instead.


Discovering Supported Types

class func availableOutputFileTypes() -> [AVFileType]

Returns an array containing UTIs identifying the file types AVCaptureAudioFileOutput can write.

Starting a Recording

func startRecording(to: URL, outputFileType: AVFileType, recordingDelegate: AVCaptureFileOutputRecordingDelegate)

Tells the receiver to start recording to a new file of the specified format, and specifies a delegate that will be notified when recording is finished.

Configuring Output

var audioSettings: [String : Any]?

The settings used to decode or re-encode audio before it is output by the receiver.

var metadata: [AVMetadataItem]

A collection of metadata to be written to the receiver's output files.

Creating Output


Creates a new audio file output.


Inherits From

Conforms To

See Also

Audio Capture

class AVCaptureAudioDataOutput

A capture output that records audio and provides access to audio sample buffers as they are recorded.