[DESCRIPTION]
上层调用各种音频回路测试方法
[SOLUTION]
如何使用这些组合,请看如下介绍:
AudioSystem.setParameters(“SET_LOOPBACK_TYPE=Type, OutputDevice”);
Type参数如下:
enum loopback_t {
NO_LOOPBACK = 0,
// AFE Loopback //以下3个是用于吹气模式
AP_MAIN_MIC_AFE_LOOPBACK = 1,
AP_HEADSET_MIC_AFE_LOOPBACK = 2,
AP_REF_MIC_AFE_LOOPBACK = 3,
// Acoustic Loopback //以下5个是可以听到说话声的。
MD_MAIN_MIC_ACOUSTIC_LOOPBACK = 21,
MD_HEADSET_MIC_ACOUSTIC_LOOPBACK = 22,
MD_DUAL_MIC_ACOUSTIC_LOOPBACK_WITHOUT_DMNR = 23,
MD_DUAL_MIC_ACOUSTIC_LOOPBACK_WITH_DMNR = 24,
MD_REF_MIC_ACOUSTIC_LOOPBACK = 25,
};
OutputDevice参数如下:
enum loopback_output_device_t {
LOOPBACK_OUTPUT_RECEIVER = 1,
LOOPBACK_OUTPUT_EARPHONE = 2,
LOOPBACK_OUTPUT_SPEAKER = 3,
};
用例如下:
// Enable Main Mic Loopback to headset
AudioSystem.setParameters(“SET_LOOPBACK_TYPE=1,2”);
// Testing …
// Disable Current Loopback Function
AudioSystem.setParameters(“SET_LOOPBACK_TYPE=0”);
如果是上层app调用,请用AudioManager.setParameters("SET_LOOPBACK_TYPE=1,2");