Skip to main content
Inspiring
April 10, 2018
Answered

silent mode doesn't stops sounds in air app.

  • April 10, 2018
  • 3 replies
  • 606 views

I have a click sound i play whenever a user clicks a button:

snd = new Sound();

  snd.load(new URLRequest("click.mp3"));

  snd.play();

When the phone is in silent mode the sound still plays - anyway to detect if the phone has been put into silent mode and disable the sound function?

This topic has been closed for replies.
Correct answer natural_criticB837

There is a difference between playback mode MEDIA which will play sounds even when the iPhone is set to silent mode (intended for audio or movie apps), this is the default setting, and playback mode AMBIENT which will go silent when silent mode is turned on (intended for games and interactive applications that do not require sound). You want to use this:

SoundMixer.audioPlaybackMode = AudioPlaybackMode.AMBIENT;

3 replies

joeboy_ukAuthor
Inspiring
April 11, 2018

ok thanks for the advice

what about the flash labs ane

https://www.myflashlabs.com/product/volume-control-adobe-air-native-extension-pro-version/

anyone tried this, could this help me? Detect if the device is on mute and then not play the sound - its only a button click i'm doing 

Colin Holgate
Inspiring
April 11, 2018

I haven't used that one, but I have used other ANEs of theirs.

Colin Holgate
Inspiring
April 10, 2018

I marked rewb0rn's answer as Correct, because that is the solution to your problem. But, you should think about whether to use that solution. I used to do that in my apps, but it does lead to a lot of support issues, and you may need to include help screens to show the user how they need to un-mute in order to hear your app's sounds. Given that iPads no longer have a mute button it ends up being a lot of work, and even then many people won't find your help screen, or they won't want to unmute the whole phone just to hear your click sounds.

It's easier just to let the user control the volume themselves. You could, as a compromise, have a preference screen in your app where the user can turn off interface sounds.

natural_criticB837
natural_criticB837Correct answer
Legend
April 10, 2018

There is a difference between playback mode MEDIA which will play sounds even when the iPhone is set to silent mode (intended for audio or movie apps), this is the default setting, and playback mode AMBIENT which will go silent when silent mode is turned on (intended for games and interactive applications that do not require sound). You want to use this:

SoundMixer.audioPlaybackMode = AudioPlaybackMode.AMBIENT;