简体   繁体   English

增加扬声器的音量超过Android的限制

[英]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%. 例如,应用程序: https://play.google.com/store/apps/details?id=com.mxtech.videoplayer.adhttps://play.google.com/store/apps/details?id=com.mxtech.videoplayer.ad可让您将音量增加到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%. 这个应用程序可能做的是增加它正在播放的文件的音量,例如当你将音量增加到超过100%时vlc播放器会这样做。 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/ 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/ 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. 但我担心,即使你使用musicg或在ringdroid中找到一些代码来帮助你,它可能仍然不容易。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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