<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFAudio",
  "identifier" : "/documentation/AVFAudio/AVAudioPlayerDelegate",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "AVFAudio"
    ],
    "preciseIdentifier" : "c:objc(pl)AVAudioPlayerDelegate"
  },
  "title" : "AVAudioPlayerDelegate"
}
-->

# AVAudioPlayerDelegate

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

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

## Overview

All of the methods in this protocol are optional.

## Topics

### Responding to Playback Completion

[`audioPlayerDidFinishPlaying(_:successfully:)`](/documentation/AVFAudio/AVAudioPlayerDelegate/audioPlayerDidFinishPlaying(_:successfully:))

Tells the delegate when the audio finishes playing.

### Responding to Audio Decoding Errors

[`audioPlayerDecodeErrorDidOccur(_:error:)`](/documentation/AVFAudio/AVAudioPlayerDelegate/audioPlayerDecodeErrorDidOccur(_:error:))

Tells the delegate when an audio player encounters a decoding error during playback.

### Responding to Audio Interruptions

[`audioPlayerBeginInterruption(_:)`](/documentation/AVFAudio/AVAudioPlayerDelegate/audioPlayerBeginInterruption(_:))

Tells the delegate when the system interrupts the audio player’s playback.

[`audioPlayerEndInterruption(_:)`](/documentation/AVFAudio/AVAudioPlayerDelegate/audioPlayerEndInterruption(_:))

Tells the delegate when the audio session interruption ends.

[`audioPlayerEndInterruption(_:withOptions:)`](/documentation/AVFAudio/AVAudioPlayerDelegate/audioPlayerEndInterruption(_:withOptions:))

Tells the delegate when the audio session interruption ends with options.

[`audioPlayerEndInterruption(_:withFlags:)`](/documentation/AVFAudio/AVAudioPlayerDelegate/audioPlayerEndInterruption(_:withFlags:))

Tells the delegate when the audio session interruption ends with flags.



---

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)