<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/AudioPlaybackController/play(at:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation23AudioPlaybackControllerC4play2atySo11AVAudioTimeC_tKF"
  },
  "title" : "play(at:)"
}
-->

# play(at:)

Plays the audio resource asynchronously at a specified time.

```
@MainActor @preconcurrency func play(at time: AVAudioTime) throws
```

## Parameters

`time`

The `AVAudioTime` at which the audio resource should start playing.

## Discussion

Use this method to schedule playback of a sound source to a precise time in the future.
This method enables sample-accurate timing for individual sounds and synchronization of
multiple audio sources.

Any call to [`play()`](/documentation/RealityKit/AudioPlaybackController/play()) cancels a pending scheduled time and
plays audio immediately. Any call to [`play(at:)`](/documentation/RealityKit/AudioPlaybackController/play(at:)) cancels a
pending scheduled time and reschedules to the new time. The controller ignores calls
to [`play()`](/documentation/RealityKit/AudioPlaybackController/play()) when audio is already playing.

Audio preparation must complete before the scheduled playback time to maintain precise
timing. If preparation is still in progress when the scheduled time arrives, or if the
scheduled time is in the past, playback starts immediately, which may result in timing
drift. For accurate synchronization, schedule a time sufficiently far in the future.

The [`isPlaying`](/documentation/RealityKit/AudioPlaybackController/isPlaying) property becomes `true` immediately after
this call returns. Code that checks `isPlaying` to decide whether to trigger another
action reads the correct state without racing against the scheduled start time.

To synchronize multiple sounds, use the same base time for all scheduled playback calls.

> Throws: An error if the controller fails to schedule playback.

---

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)