Initializer

init(forWriting:settings:commonFormat:interleaved:)

Open a file for writing using a specified processing format.

Declaration

init(forWriting fileURL: URL, settings: [String : Any], commonFormat format: AVAudioCommonFormat, interleaved: Bool) throws

Parameters

fileURL

The path to write the file.

settings

The format of the file to create. (See AVAudioRecorder.)

format

The processing format to use when writing to the file.

interleaved

Whether to use an interleaved processing format.

outError

Returns, by-reference, a description of the error, if an error occurs.

Return Value

An initialized audio file object for writing.

Discussion

The file type to create is inferred from the file extension of fileURL.

This method will overwrite a file at the specified URL if a file already exists.

See Also

Creating an Audio File

init(forReading: URL, commonFormat: AVAudioCommonFormat, interleaved: Bool)

Open a file for reading using a specified processing format.

init(forReading: URL)

Opens a file for reading.