How to mute MediaPlayer in android

 AudioManager   mAudioManager = (AudioManager) this.getSystemService(Context.AUDIO_SERVICE);

    int current_volume =mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
    //If you want to player is mute ,then set_volume variable is zero.Otherwise you may supply some value.
    int set_volume=0;
    mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC,set_volume, 0);

This code worked for me,

MediaPlayer mp = MediaPlayer.create(context, R.raw.sound_file_1);
mp.start();

for Mute

mp.setVolume(0,0);

& Unmute or full volume

mp.setVolume(1,1);