---
title: "audioPlayerDidFinishPlaying(_:successfully:)"
framework: avfaudio
role: symbol
role_heading: Instance Method
path: "avfaudio/avaudioplayerdelegate/audioplayerdidfinishplaying(_:successfully:)"
---

# audioPlayerDidFinishPlaying(_:successfully:)

Tells the delegate when the audio finishes playing.

## Declaration

```swift
optional func audioPlayerDidFinishPlaying(_ player: AVAudioPlayer, successfully flag: Bool)
```

## Parameters

- `player`: The audio player that finishes playing.
- `flag`: A Boolean value that indicates whether the audio finishes playing successfully.

## Discussion

Discussion The system doesn’t call this method on an audio interruption.
