mt6735 如何调整BT耳机中播放music的音量
时间:10-02
整理:3721RD
点击:
[DESCRIPTION]
Audio Tool 中没有地方调整 BT 耳机中播放 music 的音量,需要按如下方法修改 code.
[SOLUTION]
通过 AudiomtkPolicyManager::computeCustomVolume() 看到case AudioSystem::MUSIC:
if(OutputDevice == AudioSystem:EVICE_OUT_SPEAKER)
{
// speaker
}
else if((OutputDevice == AudioSystem::DEVICE_OUT_WIRED_HEADSET) ||
(OutputDevice==AudioSystem::DEVICE_OUT_WIRED_HEADPHONE) )
{
// headset
}
else if((OutputDevice == AudioSystem::DEVICE_OUT_EARPIECE))
{
// earpiece
}
else
{//BT
ALOGD("computeCustomVolume OutputDevice == AudioSystem::VOLUME_HEADSET_SPEAKER_MODE");
volmax =Audio_Ver1_Custom_Volume.audiovolume_media[VOLUME_HEADSET_SPEAKER_MODE
][GetStreamMaxLevels(stream)-1];
所以要修改 audio_ver1_volume_custom_default.h 中
#define VER1_AUD_VOLUME_MEDIA \
32,48,64,80,96,112,160,144,160,176,192,208,224,240,255,\// speaker
88,100,112,124,136,148,160,172,184,196,208,220,232,244,255,\//headset
68,80,92,104,116,128,140,152,168,176,188,200,212,232,248,\// earpiece
32,48,64,80,96,112,128,144,160,176,192,208,224,236,248//BT-->修改此行
Audio Tool 中没有地方调整 BT 耳机中播放 music 的音量,需要按如下方法修改 code.
[SOLUTION]
通过 AudiomtkPolicyManager::computeCustomVolume() 看到case AudioSystem::MUSIC:
if(OutputDevice == AudioSystem:EVICE_OUT_SPEAKER)
{
// speaker
}
else if((OutputDevice == AudioSystem::DEVICE_OUT_WIRED_HEADSET) ||
(OutputDevice==AudioSystem::DEVICE_OUT_WIRED_HEADPHONE) )
{
// headset
}
else if((OutputDevice == AudioSystem::DEVICE_OUT_EARPIECE))
{
// earpiece
}
else
{//BT
ALOGD("computeCustomVolume OutputDevice == AudioSystem::VOLUME_HEADSET_SPEAKER_MODE");
volmax =Audio_Ver1_Custom_Volume.audiovolume_media[VOLUME_HEADSET_SPEAKER_MODE
][GetStreamMaxLevels(stream)-1];
所以要修改 audio_ver1_volume_custom_default.h 中
#define VER1_AUD_VOLUME_MEDIA \
32,48,64,80,96,112,160,144,160,176,192,208,224,240,255,\// speaker
88,100,112,124,136,148,160,172,184,196,208,220,232,244,255,\//headset
68,80,92,104,116,128,140,152,168,176,188,200,212,232,248,\// earpiece
32,48,64,80,96,112,128,144,160,176,192,208,224,236,248//BT-->修改此行
BT播放的时候手机端发送的是纯数字信号吧?DAC转换以及模拟信号的放大是在蓝牙设备里进行的。所以BT播放音乐的时候调整音量应该是纯数字增益吧?