<!--
{
  "availability" : [
    "iOS: 3.0.0 -",
    "iPadOS: 3.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 4.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFAudio",
  "identifier" : "/documentation/AVFAudio/AVAudioRecorder/init(url:settings:)-5whyq",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "AVFAudio"
    ],
    "preciseIdentifier" : "c:objc(cs)AVAudioRecorder(im)initWithURL:settings:error:"
  },
  "title" : "init(url:settings:)"
}
-->

# init(url:settings:)

Creates an audio recorder with settings.

```
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 <doc://com.apple.documentation/documentation/ObjectiveC/nil-227m0> if an error occurred.

## Discussion

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

|Key                                                                      |Supported Values                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
|-------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|``doc://com.apple.avfaudio/documentation/AVFAudio/AVFormatIDKey``        |<doc://com.apple.documentation/documentation/CoreAudioTypes/kAudioFormatLinearPCM> ![](spacer) <doc://com.apple.documentation/documentation/CoreAudioTypes/kAudioFormatMPEG4AAC> ![](spacer) <doc://com.apple.documentation/documentation/CoreAudioTypes/kAudioFormatAppleLossless> ![](spacer) <doc://com.apple.documentation/documentation/CoreAudioTypes/kAudioFormatAppleIMA4> ![](spacer) <doc://com.apple.documentation/documentation/CoreAudioTypes/kAudioFormatiLBC> ![](spacer) <doc://com.apple.documentation/documentation/CoreAudioTypes/kAudioFormatULaw>|
|``doc://com.apple.avfaudio/documentation/AVFAudio/AVSampleRateKey``      |8 kHz to 192 kHz                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
|``doc://com.apple.avfaudio/documentation/AVFAudio/AVNumberOfChannelsKey``|1 to 64                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |

The system supports additional configuration options based on your selected audio format. See <doc://com.apple.documentation/documentation/AVFoundation/linear-pcm-format-settings> for information about customizing Linear PCM formats and <doc://com.apple.documentation/documentation/AVFoundation/encoder-settings> for compressed formats.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)