Using AudioManager you can control the volume of the media player.
AudioManager audioManager = (AudioManager)getSystemService(Context.AUDIO_SERVICE); audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, 20, 0);
also from MediaPlayer
public void setVolume (float leftVolume, float rightVolume)
for example, you can use this method as,
int maxVolume = 100; float log1=(float)(Math.log(maxVolume-currVolume)/Math.log(maxVolume)); mp.setVolume(1-log1);
source share