---
title: "audioRecorderEncodeErrorDidOccur(_:error:)"
framework: avfaudio
role: symbol
role_heading: Instance Method
path: "avfaudio/avaudiorecorderdelegate/audiorecorderencodeerrordidoccur(_:error:)"
---

# audioRecorderEncodeErrorDidOccur(_:error:)

Tells the delegate that the audio recorder encountered an encoding error during recording.

## Declaration

```swift
optional func audioRecorderEncodeErrorDidOccur(_ recorder: AVAudioRecorder, error: (any Error)?)
```

## Parameters

- `recorder`: The audio recorder that encountered the encoding error.
- `error`: An object that provides the details of the encoding error.
