You can change the “Behavior in Background” in the Player settings in Unity, I believe Unity uses this to set the AudioCategory.
FMOD will not be allowed, by the OS, to run in the background and can cause deadlocks if the AudioCategory is not set up correctly.
There is no special configuration inside FMOD required to enable the playback of audio from the lock screen or the background, there are two things you must configure outside of FMOD to do this though.
- Choose an AudioSession category that supports background / lock screen audio, see audio session basics for more details.
- Enable background audio functionality in your info.plist with the UIBackgroundModes key, see the iOS key reference for more details.
When playing audio on the lock screen (or during the fade out transition to silence when locking) it is important to ensure your buffering is configured correctly to allow low power audio playback. Please consult the latency section of this doc for further details.
If you remove the calls to
mixerPause/Resume FMOD will continue to run and process audio in the background which, if configured properly, won’t be an issue.