---
title: "play(at:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/audioplaybackgroupcontroller/play(at:)"
---

# play(at:)

Plays all audio resources in the group asynchronously at a specified time.

## Declaration

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

## Parameters

- `time`: The AVAudioTime at which the group should start playing.

## Discussion

Discussion Use this method to schedule playback of the group to a precise time in the future. This method enables sample-accurate timing for the group and synchronization with other audio sources. Any call to play() cancels a pending scheduled time and plays audio immediately. Any call to play(at:) cancels a pending scheduled time and reschedules to the new time. The controller ignores calls to 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 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 this group with other audio sources, use the same base time for all scheduled playback calls. note: An error if the controller fails to schedule playback.

## See Also

### Controlling playback

- [seek(to:)](realitykit/audioplaybackgroupcontroller/seek(to:).md)
