Contents

init(forWriting:settings:)

Opens a file for writing using the specified settings.

Declaration

init(forWriting fileURL: URL, settings: [String : Any]) throws

Parameters

  • fileURL:

    The path of the file to create for writing.

  • settings:

    The format of the file to create.

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.

The file opens for writing using the standard format AVAudioCommonFormat.pcmFormatFloat32. For more information about the settings parameter, see the settings property in the AVAudioRecorder class.

See Also

Related Documentation

Creating an Audio File