0

In my application a sound is triggered by a button click, but the sound is relatively quiet and requires me to manually increase the volume on my phone to hear. Is there a way to increase the volume so that it get's louder quicker? Our plays louder by default?

Edit: the set volume function didn't have an effect on the overall loudness without physically changing the volume on my phone. Am I doing something wrong or have the wrong values

JavaHava
  • 189
  • 2
  • 15
  • Possible duplicate of [Android: MediaPlayer setVolume function](https://stackoverflow.com/questions/5215459/android-mediaplayer-setvolume-function) – Morrison Chang Jun 09 '19 at 22:30

1 Answers1

2

you can use setVolume method

mediaPlayer.setVolume(0.09f , 0.09f);//0,09f = 90% of volume

public void setVolume (float leftVolume, float rightVolume)

ismail alaoui
  • 5,748
  • 2
  • 21
  • 38