React-native-sound: Silent button does not mute sounds from react-native-sound

Created on 8 May 2017  路  2Comments  路  Source: zmxv/react-native-sound

I cannot find any solution to mute the sounds when the iPhone silent switch is on "silent". The iPhone just plays the Sounds at maximum volume. Is there a way to support that switch?

(I am trying to implement react-native-silent-switch but it looks like a bad practice to me to play a unhearable sound in the background just to detect the switch state)

question

Most helpful comment

Ok, got it. Its a feature. I changed the category from Playback to Ambient to make it work.

Sound.setCategory('Playback');
Sound.setCategory('Ambient');

All 2 comments

Ok, got it. Its a feature. I changed the category from Playback to Ambient to make it work.

Sound.setCategory('Playback');
Sound.setCategory('Ambient');

Hello,

Problem is that Playback allow sounds to get played in background, but in my case, I want to play a sound in background, but managed by the "Ring" channel volume. Ambient cannot resolve my case, because of, the volume is cut when app goes background, and get back when app goes foreground.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

VladimirJarabica picture VladimirJarabica  路  3Comments

nfq6612 picture nfq6612  路  3Comments

viperfx picture viperfx  路  4Comments

jacargentina picture jacargentina  路  4Comments

LCD344 picture LCD344  路  5Comments