---
title: PHASEEngine
framework: phase
role: symbol
role_heading: Class
path: phase/phaseengine
---

# PHASEEngine

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

## Declaration

```swift
class PHASEEngine
```

## Overview

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:) argument that selects the desired control over scene setup and playback timing. // 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. do { try engine.start() }  catch { /* Handle the error. */ } To stop audio playback and enable the engine to deallocate system resources, call the stop() function. engine.stop()

## Topics

### Creating an Engine

- [init(updateMode:)](phase/phaseengine/init(updatemode:).md)
- [init(updateMode:renderingMode:)](phase/phaseengine/init(updatemode:renderingmode:).md)
- [PHASEEngine.UpdateMode](phase/phaseengine/updatemode.md)
- [PHASEEngine.RenderingMode](phase/phaseengine/renderingmode.md)

### Registering Audio Resources

- [assetRegistry](phase/phaseengine/assetregistry.md)

### Accessing Scene Hierarchy

- [rootObject](phase/phaseengine/rootobject.md)

### Defining Environmental Effects

- [defaultReverbPreset](phase/phaseengine/defaultreverbpreset.md)
- [defaultMedium](phase/phaseengine/defaultmedium.md)
- [outputSpatializationMode](phase/phaseengine/outputspatializationmode.md)

### Controlling and Inspecting Playback State

- [pause()](phase/phaseengine/pause().md)
- [start()](phase/phaseengine/start().md)
- [stop()](phase/phaseengine/stop().md)
- [update()](phase/phaseengine/update().md)
- [renderingState](phase/phaseengine/renderingstate.md)
- [lastRenderTime](phase/phaseengine/lastrendertime.md)

### Managing Groups of Sounds

- [groups](phase/phaseengine/groups.md)
- [activeGroupPreset](phase/phaseengine/activegrouppreset.md)
- [duckers](phase/phaseengine/duckers.md)

### Accessing In-Flight Audio

- [soundEvents](phase/phaseengine/soundevents.md)

### Measuring Units

- [unitsPerMeter](phase/phaseengine/unitspermeter.md)
- [unitsPerSecond](phase/phaseengine/unitspersecond.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Setup

- [PHASEEngine.UpdateMode](phase/phaseengine/updatemode.md)
- [PHASEEngine.RenderingMode](phase/phaseengine/renderingmode.md)
- [PHASEAssetRegistry](phase/phaseassetregistry.md)
- [PHASENormalizationMode](phase/phasenormalizationmode.md)
- [PHASESpatializationMode](phase/phasespatializationmode.md)
- [PHASEReverbPreset](phase/phasereverbpreset.md)
- [PHASEMedium](phase/phasemedium.md)
