In my app, I am trying to set the volume when playing an audio clip to the maximum level but it doesn't appear to have any affect. I have to manually adjust the volume to the maximum level. Here's my code:
MediaPlayer mp = new MediaPlayer();
mp.setVolume(1, 1);
From Settings, choose Sounds and vibration and Volume, then tap the three dots (top right) and choose Media volume limit.
AudioManager
int origionalVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, mAudioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC), 0);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With