---
title: prepareToRecord()
framework: avfaudio
role: symbol
role_heading: Instance Method
path: avfaudio/avaudiorecorder/preparetorecord()
---

# prepareToRecord()

Creates an audio file and prepares the system for recording.

## Declaration

```swift
func prepareToRecord() -> Bool
```

## Return Value

Return Value true if successful; otherwise, false.

## Discussion

Discussion Calling this method creates an audio file at the URL you used to create the recorder. If a file already exists at that location, this method overwrites it. Call this method to start recording as quickly as possible upon calling record().

## See Also

### Controlling recording

- [record()](avfaudio/avaudiorecorder/record().md)
- [record(atTime:)](avfaudio/avaudiorecorder/record(attime:).md)
- [record(forDuration:)](avfaudio/avaudiorecorder/record(forduration:).md)
- [record(atTime:forDuration:)](avfaudio/avaudiorecorder/record(attime:forduration:).md)
- [pause()](avfaudio/avaudiorecorder/pause().md)
- [stop()](avfaudio/avaudiorecorder/stop().md)
- [isRecording](avfaudio/avaudiorecorder/isrecording.md)
- [deleteRecording()](avfaudio/avaudiorecorder/deleterecording().md)
