Audio Gets Muted When App Loses Focus

I have just tested my app with TestFlight, but I have a strange issue:

At start, the audio works just fine - even better than on Android (in terms of delay). But, once the app loses its focus (for example, going out from the app and back in, or starting Siri), the app audio gets muted and never comes back to normal until I restart the app (closing it completely from the recents menu).

To be noted, the audio doesn’t get muted when the In App Purchase popup shows up, or when the user pulls the notifications/quick settings tray.

Built from unity 2018.3.5f1.
Tested on iPhone 6, iOS 12.1.4.
Playing audio using Audio Source with different audio clips, both for background music and sound effects. (some of the files are .mp3 and some are .wav).

Another note: I have music controls in my game which let the users mute or unmute the background music and the sound effects. In theory they pull the Unity Audio Mixer’s db value down to -80db and back to 0db, but no they don’t work at all. So I guess the problem is not with the Audio Mixer.

Thanks!

I’m also having this issue. When Siri is invoked and then cancelled, all audio sources stop producing sound until a new scene is loaded, or the current scene is loaded again.

I have done some testing, and have found that the audio source DOES keep playing. The time stamp on the audio continues to move forward, but the app produces no sound. Stopping and starting the audio source does not solve the issue.

Is there any way to resolve this?

Quite old thread, but I’m also facing this issue on Android.
@itayganor @atalkingfish Did you solve this for your apps?

1 Like

Happens to me too but the issue only seems to occur on Android 12. Minimizing the app and then bringing it back to focus results in the audio being “muted”. I tested it on an Android 9 device and didn’t experience the issue. Are there any solutions for this?