Contents

init(url:settings:)

Creates an audio recorder with settings.

Declaration

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

Parameters

  • url:

    The file system location to record to.

  • settings:

    The audio settings to use for the recording.

Return Value

A new audio recorder, or nil if an error occurred.

Discussion

The system supports the following keys when defining the format settings:

Key

Supported Values

Avformatidkey

Kaudioformatlinearpcm [Image] Kaudioformatmpeg4aac [Image] Kaudioformatapplelossless [Image] Kaudioformatappleima4 [Image] Kaudioformatilbc [Image] Kaudioformatulaw

Avsampleratekey

8 kHz to 192 kHz

Avnumberofchannelskey

1 to 64

The system supports additional configuration options based on your selected audio format. See Linear PCM format settings for information about customizing Linear PCM formats and Encoder settings for compressed formats.

See Also

Creating an audio recorder