---
title: update()
framework: phase
role: symbol
role_heading: Instance Method
path: phase/phaseengine/update()
---

# update()

Processes app commands and increments framework processing.

## Declaration

```swift
func update()
```

## Discussion

Discussion This function consumes the app’s API calls since the last update(), adjusts internal systems, objects, increments parameters, and invokes the app’s queued callbacks. An API call may require several update() invocations before the output device reflects the call’s results. The framework ignores calls to this function for engines with updateMode set to PHASEEngine.UpdateMode.automatic; for more more information, see init(updateMode:). note: The frequency that the app calls this function doesn’t change the speed by which PHASE plays audio in real time. Update an Engine Manually On an engine configured for manual updates (PHASEEngine.UpdateMode.manual), call this function periodically to instruct the framework to process API calls and perform internal updates. Call update() at a rate that matches your app’s visuals or logic update rate for optimal performance: Apps that process graphics at 60 FPS can invoke update() in their display link callback. Rates in the range of 240Hz to 30Hz offer equivalent audio performance, however apps that actively change the parameters of playing audio achieve smoother interpolation at a higher rate. If a game skips frames due to long running graphics routines, an app can throttle update() calls to values less than 30Hz without affecting audio quality as long as the system isn’t overloaded. This function offers thread safety for apps that intend to call update() off of the main thread.

## See Also

### Controlling and Inspecting Playback State

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