How to set volume in decibels using my android mobile application?
问题 I am working on a mobile app, where i need to play the sound file. On volume button press, i need to increase/decrease the volume through my app. I am using Media player to play and using SetVolume(left, right) function to set the volume. MediaPlayer mp; float left = 0.0f; float right = 0.6f; public void OnPlay(View v){ mp = MediaPlayer.create(this, R.raw.twofiftybeep); audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); mp.start(); mp.setOnCompletionListener(new