---
title: AVAudioPlayerDelegate
framework: avfaudio
role: symbol
role_heading: Protocol
path: avfaudio/avaudioplayerdelegate
---

# AVAudioPlayerDelegate

A protocol that defines the methods to respond to audio playback events and decoding errors.

## Declaration

```swift
@MainActor protocol AVAudioPlayerDelegate : NSObjectProtocol
```

## Overview

Overview All of the methods in this protocol are optional.

## Topics

### Responding to Playback Completion

- [audioPlayerDidFinishPlaying(_:successfully:)](avfaudio/avaudioplayerdelegate/audioplayerdidfinishplaying(_:successfully:).md)

### Responding to Audio Decoding Errors

- [audioPlayerDecodeErrorDidOccur(_:error:)](avfaudio/avaudioplayerdelegate/audioplayerdecodeerrordidoccur(_:error:).md)

### Responding to Audio Interruptions

- [audioPlayerBeginInterruption(_:)](avfaudio/avaudioplayerdelegate/audioplayerbegininterruption(_:).md)
- [audioPlayerEndInterruption(_:)](avfaudio/avaudioplayerdelegate/audioplayerendinterruption(_:).md)
- [audioPlayerEndInterruption(_:withOptions:)](avfaudio/avaudioplayerdelegate/audioplayerendinterruption(_:withoptions:).md)
- [audioPlayerEndInterruption(_:withFlags:)](avfaudio/avaudioplayerdelegate/audioplayerendinterruption(_:withflags:).md)

## Relationships

### Inherits From

- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Responding to player events

- [delegate](avfaudio/avaudioplayer/delegate.md)
