Android: how to play music at maximum possible volume?

后端 未结 5 1533
-上瘾入骨i
-上瘾入骨i 2020-12-03 04:52

I know the question can be regarded as \"politically incorrect\", but I\'m designing an app which \"by design\" must get the attention of people within the maximum possible

5条回答
  •  星月不相逢
    2020-12-03 05:54

        float count=100*.01f;
    
    MediaPlayer mp=new MediaPlayer();
    
     mp.setLooping(false);     
               mp = MediaPlayer.create(ActivityName.this, myUri);
    
              mp.setVolume(count,count);  
               mp.start(); 
     mp.setOnCompletionListener(new OnCompletionListener() {
    
                public void onCompletion(MediaPlayer mp) {
                    // TODO Auto-generated method stub
                                     mp.release(); 
                     mp.stop(); 
                }
            });
    

提交回复
热议问题