Android : How to set MediaPlayer volume programmatically?

后端 未结 10 534
你的背包
你的背包 2020-12-08 04:17

How to set the mediaplayer volume programmatically. I use it for alarm notification. Any help is highly appreciated and thanks in advance.

10条回答
  •  不知归路
    2020-12-08 04:37

    Remember to set left and right speaker volumes.

    if (System.nanoTime() == alarm){
        yourMediaPlayer.setVolume(volume, volume)}
    }
    

提交回复
热议问题