Audio play even when phone sound is set to MUTE
Opened this issue · 7 comments
I am using the plugin inside my ionic app.
The sound plays correctly.
The problem is that when the sound setting in the phone is set to MUTE - It plays anyway.
The Vibration plugin for example don't start if the settings are on MUTE.
Do you think it can be fixed in the plugin?
Thanks!
This is for anyone else who has this issue. Here is how I fixed it.
In NativeAudio.m line 10 replace #import <AVFoundation/AVAudioSession.h>
with #import <AVFoundation/AVFoundation.h>
Line 48 replace [session setCategory:AVAudioSessionCategoryPlayback error:nil];
with [session setCategory:AVAudioSessionCategoryAmbient error:nil];
This worked perfect for me. You can also remove line 32 to prevent a depreciation warning.
When can be expect this issue to be fixed? This is happening in the Android as well
This is for anyone else who has this issue. Here is how I fixed it.
In NativeAudio.m line 10 replace
#import <AVFoundation/AVAudioSession.h>
with#import <AVFoundation/AVFoundation.h>
Line 48 replace
[session setCategory:AVAudioSessionCategoryPlayback error:nil];
with[session setCategory:AVAudioSessionCategoryAmbient error:nil];
This worked perfect for me. You can also remove line 32 to prevent a depreciation warning.
Hello,
I have tried this, but still no sound when in silent mode :(
We are now maintaining a forked version wizpanda/cordova-plugin-nativeaudio of this plugin which fixes this issue.
@sagrawal31 does you fork also have a fix for Android?
Yes @soulfly our fork fixes this issue for Android
Yes @soulfly our fork fixes this issue for Android
@sagrawal31 tried your fork but I'm still getting sound when my device is in mute or vibrate (Android)