A controller that manages audio playback of a resource.
- iOS 13.0+
- macOS 10.15+
- Mac Catalyst 13.0+
- Xcode 11.0+
You receive an audio playback controller by calling an entity’s
prepare method. You typically pass an
Audio instance to this call that tells the playback controller how to stream the contents of an audio file from disk, or from a URL.
During playback, the audio appears to come from the entity that you used to create the controller. As the user moves around the AR scene, RealityKit modulates the characteristics of the audio to account for the user’s location.
After playback completes, or if you call the
stop() method, the audio controller resets so that you can play the resource from the beginning. Alternatively, you can configure the audio to loop indefinitely by setting the loops property of the audio resource to
Look for one of the events in
Audio if you want to be alerted when certain aspects of audio playback occur.