init(forWriting:settings:commonFormat:interleaved:)
Opens a file for writing using a specified processing format and settings.
Declaration
init(forWriting fileURL: URL, settings: [String : Any], commonFormat format: AVAudioCommonFormat, interleaved: Bool) throwsParameters
- fileURL:
The path at which to create the file.
- settings:
The format of the file to create.
- format:
The processing format to use when writing to the file.
- interleaved:
The Boolean value that indicates whether to use an interleaved processing format.
Return Value
A new AVAudioFile instance for writing.
Discussion
This method infers the file type to create from the file extension of fileURL, and overwrites a file at the specified URL if a file exists.
For more information about the settings parameter, see the settings property in the AVAudioRecorder class.