muteState not working properly?

When I’m using UnityEngine.AudioSettings.Mobile.muteState to know if the device is muted, its returning true on some android devices when the phone is not muted.

Am I missing something? Do I need to set something before use this? Or is it broken?

I’m using Unity 2020.3.40f1

I’ve never used muteState. I don’t think I’ve ever even used anything in that .Mobile. namespace either.

I just set the volume to zero, either in all of my AudioSources, or else in my AudioSettings.

It’s the other way around, I want to know if the user is playing with no sound to ask them to turn it on, because they will miss a crucial information

Hm, I see. That’s why I never use it: the device being muted is really only one of so many ways that audio could be blocked I’m not sure it should relied upon for game design.

Instead a screen saying “You need to hear audio cues, turn up your audio!” would probably serve you better.

Also ran into this issue when updating Target API to API Level 31 on Android. AudioSettings.Mobile.muteState was working fine before but now mistakenly claiming Android phone is muted when it is not.