I was trying to use MediaPlayer and AudioManager to change the volume of an audio file using app buttons. I seem to have messed up my emulator. The volume setting of the emulator and of my speakers is maxed but I can barely hear the sound file. Audio from other applications are working normally. I tried clearing the data from the emulator but that had no effect. Is there some way to reset the volume settings? I was using the following suggestions from other posts.
AudioManager am = (AudioManager) getSystemService(AUDIO_SERVICE);
int currVolume= am.getStreamVolume(AudioManager.STREAM_MUSIC);
currVolume++; // to change the volume
int maxVolume = 50;
float log1=(float)(Math.log(maxVolume-currVolume)/Math.log(maxVolume));
yourMediaPlayer.setVolume(1f-log1, 1f-log1);
Every time I executed this code on the emulator, the volume got lower and I can't bring it back up, no matter what I put in .setVolume()