简体   繁体   中英

Increase volume of speakerphone over the limit Android

I use this code to set the maximum volume of the speaker.

AudioManager audioManager.setMode(AudioManager.MODE_IN_CALL); 
audioManager.setStreamVolume(AudioManager.STREAM_MUSIC,audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC),0);
            audioManager.setSpeakerphoneOn(false);

I would increase more this volume, but how can i do? I tried to use this:

audioManager.setStreamVolume(AudioManager.STREAM_MUSIC,2,0);

But nothing, the volume remain set to the same level.

An app as this: https://play.google.com/store/apps/details?id=com.mxtech.videoplayer.ad , for example, allow you to increase the volume to the 300%.

Any help? Thank you.

What this app probably does is increase the volume of the file it is playing like for example the vlc player does when you increase the volume beyond 100%. It has nothing to do with the volume you set to the phone, it just compensates for files which have a more quiet audio track.

EDIT:

Of the top of my head I don't know of an easy solution, I imagine it would be very difficult to write such a functionality yourself. That's why I suggest you look for a library such as this:
https://code.google.com/p/musicg/

Or you can look at open source projects which implement this functionality or at least something similar such as this:
https://code.google.com/p/ringdroid/

But I fear even if you use musicg or find some bits of code in ringdroid which help you it's probably still not going to be easy.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM