title: Android webRTC audio volume
body: <p>I'm using APPRTCdemo app on android. I'm trying to make it play the sound coming from the other peer as loud as the volume is set in the Android settings. So if the user muted the device, the audio would not be heard.
  I tried pretty much every Android API call, but nothing seems to have any effect on the volume.
  These are the things I tried:
    AudioManager audioManager = (AudioManager)_context.getSystemService(Context.AUDIO_SERVICE);
          int volume = audioManager.getStreamVolume(AudioManager.STREAM_VOICE_CALL);</p>
  
  <pre><code>    volume = audioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
      volume =audioManager.getStreamVolume(AudioManager.STREAM_RING);
      volume =audioManager.getStreamVolume(AudioManager.STREAM_ALARM);
      volume =audioManager.getStreamVolume(AudioManager.STREAM_NOTIFICATION);
      volume =audioManager.getStreamVolume(AudioManager.STREAM_SYSTEM);
  
      audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, 0, AudioManager.FLAG_REMOVE_SOUND_AND_VIBRATE);
      audioManager.setStreamVolume(AudioManager.MODE_IN_COMMUNICATION, 0, AudioManager.FLAG_REMOVE_SOUND_AND_VIBRATE);
      audioManager.setStreamVolume(AudioManager.STREAM_VOICE_CALL, 0,AudioManager.FLAG_REMOVE_SOUND_AND_VIBRATE);
      audioManager.setStreamMute(AudioManager.MODE_IN_COMMUNICATION, true);
      audioManager.setStreamMute(AudioManager.STREAM_SYSTEM, true);
      audioManager.setStreamMute(AudioManager.STREAM_RING, true);
      audioManager.setStreamMute(AudioManager.STREAM_MUSIC, true);
      audioManager.setStreamMute(AudioManager.STREAM_NOTIFICATION, true);
  </code></pre>