Reputation: 443
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.
Upvotes: 0
Views: 3271
Reputation: 49797
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.
Upvotes: 2