---
title: AudioPlaybackController
framework: realitykit
role: symbol
role_heading: Class
path: realitykit/audioplaybackcontroller
---

# AudioPlaybackController

A controller that manages an audio playback instance.

## Declaration

```swift
@MainActor @preconcurrency class AudioPlaybackController
```

## Overview

Overview You can obtain an audio playback controller by calling an entity’s Entity/prepareAudio(:) or Entity/playAudio(:) method which creates a controller with the associated AudioResource. To play multiple instances of a resource, call playAudio(_:) to obtain new AudioPlaybackControllers. During playback, the audio appears to come from the entity that you used to create the controller. As you move around the MR scene, RealityKit modulates the characteristics of the audio to account for your location. note: Playback commences only after the entity is parented and placed within a scene. After playback completes, or if you call the stop() method, the audio resource resets, allowing you to replay the resource from the beginning. Alternatively, you can enable indefinite looping by setting the loops property of the audio resource to true. Look for one of the events in AudioEvents if you want to be alerted when certain aspects of audio playback occur.

## Topics

### Managing the resource

- [resource](realitykit/audioplaybackcontroller/resource.md)

### Setting the volume

- [gain](realitykit/audioplaybackcontroller/gain.md)
- [fade(to:duration:)](realitykit/audioplaybackcontroller/fade(to:duration:).md)

### Setting the speed

- [speed](realitykit/audioplaybackcontroller/speed.md)

### Setting the reverb

- [reverbSendLevel](realitykit/audioplaybackcontroller/reverbsendlevel.md)

### Starting and stopping audio playback

- [play()](realitykit/audioplaybackcontroller/play().md)
- [pause()](realitykit/audioplaybackcontroller/pause().md)
- [stop()](realitykit/audioplaybackcontroller/stop().md)
- [isPlaying](realitykit/audioplaybackcontroller/isplaying.md)

### Handling completion

- [completionHandler](realitykit/audioplaybackcontroller/completionhandler.md)

### Finding the associated entity

- [entity](realitykit/audioplaybackcontroller/entity.md)

### Scheduling audio playback

- [play(at:)](realitykit/audioplaybackcontroller/play(at:).md)

### Instance Methods

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

### Type Aliases

- [AudioPlaybackController.Decibel](realitykit/audioplaybackcontroller/decibel.md)

## Relationships

### Conforms To

- [Copyable](swift/copyable.md)
- [Escapable](swift/escapable.md)
- [Identifiable](swift/identifiable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Playback controllers

- [AudioGeneratorController](realitykit/audiogeneratorcontroller.md)
- [AudioGeneratorConfiguration](realitykit/audiogeneratorconfiguration.md)
- [AudioEvents](realitykit/audioevents.md)
- [PlayAudioAction](realitykit/playaudioaction.md)
