<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PHASE",
  "identifier" : "/documentation/PHASE/PHASEEngine",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "PHASE"
    ],
    "preciseIdentifier" : "c:objc(cs)PHASEEngine"
  },
  "title" : "PHASEEngine"
}
-->

# PHASEEngine

An object that manages audio assets, controls playback, and configures environmental effects.

```
class PHASEEngine
```

## Overview

Before using PHASE, an app creates an instance of this object. Apps access all of the framework’s functionality through engine functions or properties, or through other PHASE classes into which you pass the engine object.

> Important:
> You can create multiple engine instances, but normally, apps create only one.

### Create and Start the Engine

To create an engine object, choose a value for the [`init(updateMode:)`](/documentation/PHASE/PHASEEngine/init(updateMode:)) argument that selects the desired control over scene setup and playback timing.

```swift
// Apps that need precise audio synchronization and 
// synchronized dynamic mix control pass in `.manual`.
engine = PHASEEngine(updateMode: .automatic) 
```

Then, load your sound assets, sound event assets, and shapes for sound occlusion. Before your app attempts to play sounds, start the engine object.

```swift
do { try engine.start() } 
catch { /* Handle the error. */ }
```

To stop audio playback and enable the engine to deallocate system resources, call the [`stop()`](/documentation/PHASE/PHASEEngine/stop()) function.

```swift
engine.stop()
```

## Topics

### Creating an Engine

[`init(updateMode:)`](/documentation/PHASE/PHASEEngine/init(updateMode:))

Creates an engine updated by the app or framework.

[`init(updateMode:renderingMode:)`](/documentation/PHASE/PHASEEngine/init(updateMode:renderingMode:))

Creates a new engine that has both update and rendering modes.

[`PHASEEngine.UpdateMode`](/documentation/PHASE/PHASEEngine/UpdateMode)

Modes that determine when the framework consumes API calls and updates internal state.

[`PHASEEngine.RenderingMode`](/documentation/PHASE/PHASEEngine/RenderingMode)

Modes that determine whether the system renders audio in process or out of process.

### Registering Audio Resources

[`assetRegistry`](/documentation/PHASE/PHASEEngine/assetRegistry)

An object that loads and unloads audio resources.

### Accessing Scene Hierarchy

[`rootObject`](/documentation/PHASE/PHASEEngine/rootObject)

The main object to which the app adds child objects.

### Defining Environmental Effects

[`defaultReverbPreset`](/documentation/PHASE/PHASEEngine/defaultReverbPreset)

The environmental surroundings that determine how sound resonates.

[`defaultMedium`](/documentation/PHASE/PHASEEngine/defaultMedium)

The physical matter through which sound travels.

[`outputSpatializationMode`](/documentation/PHASE/PHASEEngine/outputSpatializationMode)

The mode the engine implements to create a 3D sound experience.

### Controlling and Inspecting Playback State

[`pause()`](/documentation/PHASE/PHASEEngine/pause())

Pauses all audio playback.

[`start()`](/documentation/PHASE/PHASEEngine/start())

Starts or resumes all audio playback.

[`stop()`](/documentation/PHASE/PHASEEngine/stop())

Stops all audio playback.

[`update()`](/documentation/PHASE/PHASEEngine/update())

Processes app commands and increments framework processing.

[`renderingState`](/documentation/PHASE/PHASEEngine/renderingState)

The status of the engine’s audio playback.

[`lastRenderTime`](/documentation/PHASE/PHASEEngine/lastRenderTime)

### Managing Groups of Sounds

[`groups`](/documentation/PHASE/PHASEEngine/groups)

A list of named groups that contain sounds the app operates on collectively.

[`activeGroupPreset`](/documentation/PHASE/PHASEEngine/activeGroupPreset)

The settings that define playback for a group of sounds.

[`duckers`](/documentation/PHASE/PHASEEngine/duckers)

An array of objects that reduce the volume of simultaneously playing sounds.

### Accessing In-Flight Audio

[`soundEvents`](/documentation/PHASE/PHASEEngine/soundEvents)

A collection of the sounds that play under various runtime circumstances.

### Measuring Units

[`unitsPerMeter`](/documentation/PHASE/PHASEEngine/unitsPerMeter)

A conversion factor from meters to your app’s preferred unit of measurement.

[`unitsPerSecond`](/documentation/PHASE/PHASEEngine/unitsPerSecond)

A conversion factor from seconds to your app’s preferred unit of time.



---

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)