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

# init(url:format:)

Creates an audio recorder with an audio format.

```
init(url: URL, format: AVAudioFormat) throws
```

## Parameters

`url`

The file system location to record to.

`format`

The audio format 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

---

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)