<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/AudioPlaybackController/completionHandler",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation23AudioPlaybackControllerC17completionHandleryycSgvp"
  },
  "title" : "completionHandler"
}
-->

# completionHandler

A closure that the playback controller executes when it reaches the end
of the audio stream.

```
@MainActor @preconcurrency var completionHandler: (() -> Void)? { get set }
```

## Discussion

The controller doesn’t call the closure if you manually stop the audio
by calling the [`stop()`](/documentation/RealityKit/AudioPlaybackController/stop()) or the
[`pause()`](/documentation/RealityKit/AudioPlaybackController/pause()) method.

> Note: You can only register one handler at a time. If you set a new handler,
> the controller discards the old one.

---

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)