Allowing background music and the mute button on iOS

I have background music enabled in my app as described here.

The problem is if a player has muted the iOS device with the mute button you can still here the game sounds. This is not the behavior I notice from other apps. Other apps that allow background music will mute the game sfx when the device is muted.

Any workaround for this? 

Gonna try a bump! It is quite annoying when my game starts blasting sounds while muted :slight_smile: Do others have this problem when allowing background music?

I don’t know if this is the expected behavior or not.  I would go ahead and file a bug report.  Engineering is going to want a project.

Rob

The issue is that the mute button on iOS devices mutes the Ringer, not the Volume.

If you start the Music app on iOS and play a song you’ll still hear music being played even though the device is “muted” as the mute button is only muting the Ringer…

I just tried at least 10 apps and as soon as you hit the mute button the volume is muted. This is the case for Corona apps as well if they don’t have background music enabled.

The music app should play even if muted as you said. Games that allow background music always only mute the SFX which I think is the standard way.

I guess I will report this then.

OK I found a couple of apps that allow background music and are not muting on mute. I guess this is all over the place.

I guess it’s a matter of how the core audio functions are implemented. It might be possible for CoronaLabs to figure out a way to mute the audio even though UIBackgroundModes={“audio”} is active.

If you remove  UIBackgroundModes = {“audio”}  from your build.settings, then the audio will not play while muted. However it will stop any music playing when you start the app.

Yeah or maybe the native way might also  be to detect when device is muted and just not play the sounds then. Don’t think we have that option. addEventListener is not picking up anything when I press the mute button at least.

This (rather old) thread seems to address the issue natively. Haven’t tried it though…

http://stackoverflow.com/questions/287543/how-to-programmatically-sense-the-iphone-mute-switch

Thanks for the help. I’m going to dump this issue onto my low priority pile for now. Maybe I’ll make a feature request.

Gonna try a bump! It is quite annoying when my game starts blasting sounds while muted :slight_smile: Do others have this problem when allowing background music?

I don’t know if this is the expected behavior or not.  I would go ahead and file a bug report.  Engineering is going to want a project.

Rob

The issue is that the mute button on iOS devices mutes the Ringer, not the Volume.

If you start the Music app on iOS and play a song you’ll still hear music being played even though the device is “muted” as the mute button is only muting the Ringer…

I just tried at least 10 apps and as soon as you hit the mute button the volume is muted. This is the case for Corona apps as well if they don’t have background music enabled.

The music app should play even if muted as you said. Games that allow background music always only mute the SFX which I think is the standard way.

I guess I will report this then.

OK I found a couple of apps that allow background music and are not muting on mute. I guess this is all over the place.

I guess it’s a matter of how the core audio functions are implemented. It might be possible for CoronaLabs to figure out a way to mute the audio even though UIBackgroundModes={“audio”} is active.

If you remove  UIBackgroundModes = {“audio”}  from your build.settings, then the audio will not play while muted. However it will stop any music playing when you start the app.

Yeah or maybe the native way might also  be to detect when device is muted and just not play the sounds then. Don’t think we have that option. addEventListener is not picking up anything when I press the mute button at least.

This (rather old) thread seems to address the issue natively. Haven’t tried it though…

http://stackoverflow.com/questions/287543/how-to-programmatically-sense-the-iphone-mute-switch