---
title: "init(url:format:)"
framework: avfaudio
role: symbol
role_heading: Initializer
path: "avfaudio/avaudiorecorder/init(url:format:)-7herw"
---

# init(url:format:)

Creates an audio recorder with an audio format.

## Declaration

```swift
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

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

## See Also

### Creating an audio recorder

- [init(url:settings:)](avfaudio/avaudiorecorder/init(url:settings:)-5whyq.md)
