2

I am revisiting an old question posted (in early 2014 mind) here:

For a recent project, I am building an app that can mute an existing call and get an audio recording from the user. I know that audio-recording in-call works, that's no problem (recording only the user mic). Now i can also reduce the volume programmatically, which i did using the code On my Github, Here

Specifically, I am using the AudioManager class to set the volume to 0 and also muting as a backup, but doesn't work.. I am wondering whether this is a Samsung specific issue or not..

mgr.setStreamVolume(stream, progress, AudioManager.FLAG_REMOVE_SOUND_AND_VIBRATE);
mgr.adjustVolume(AudioManager.ADJUST_MUTE, AudioManager.FLAG_VIBRATE);
boolean a = mgr.isVolumeFixed();
Log.d("MUTING", "Volume fixed: "+a);
boolean streamMuteStatus = mgr.isStreamMute(stream);
Log.d("MUTING", "Stream Mute Status: "+streamMuteStatus);

I am printing out the boolean variables above for testing purposes, but both print out 'False'.

But the Samsung S5 device is not allowing me to set the volume to 0 at all. This is true even when adjusting the in-call volume using the volume slider.. The slider does not physically move to the leftmost position on the seekbar. See figure below for the leftmost position i can drag to:

The minimum position of the call volume seekbar

Anyone have any ideas about how i can mute the incoming call stream?

Nick Cardoso
  • 20,807
  • 14
  • 73
  • 124
BykerHero
  • 118
  • 2
  • 10

0 Answers0