三星设备上的 AcousticEchoCanceler 不工作 [英] AcousticEchoCanceler on Samsung devices not working

查看:101
本文介绍了三星设备上的 AcousticEchoCanceler 不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 AcousticEchoCanceler 为我尝试过的所有其他设备类型处理 VoIP 呼叫,但不适用于任何三星设备.设备报告 AcousticEchoCanceler 可用,但它什么也不做.

I have AcousticEchoCanceler working for VoIP calls for every other device type I've tried, but not on any Samsung device. The device reports AcousticEchoCanceler being available but it simply does nothing.

我有什么:

  • acousticEchoCanceler.setEnabled(true);
  • audioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
  • 传递给 AudioTrack
  • 的音频会话 ID
  • 采样率:16k
  • 尝试了单声道和立体声录音

有没有人让 AcousticEchoCanceler 在三星设备上工作?

Has anyone got AcousticEchoCanceler to work on a Samsung device?

推荐答案

我最近遇到了同样的问题.对我来说最重要的部分是在创建 AudioRecord 之前使用 audioManager.setMode(AudioManager.MODE_IN_COMMUNICATION).

I had the same issue recently. The most important part for me was to use audioManager.setMode(AudioManager.MODE_IN_COMMUNICATION) before creating the AudioRecord.

接下来使用以下命令创建 AudioRecord:

Next the AudioRecord was created with :

mAudioRecord = new AudioRecord(MediaRecorder.AudioSource.VOICE_COMMUNICATION, mSamplingRate, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_16BIT, audioRecordBufferSize);

最后创建并启用 NS 和 AEC :

And finally create and enable the NS and AEC :

mNoiseSuppressor = NoiseSuppressor.create(mAudioRecord.getAudioSessionId());
if (mNoiseSuppressor != null) {
    int res = mNoiseSuppressor.setEnabled(true);
}

mAcousticEchoCanceler = AcousticEchoCanceler.create(mAudioRecord.getAudioSessionId());
if (mAcousticEchoCanceler != null) {
    int res = mAcousticEchoCanceler.setEnabled(true);
}

AudioTrack 不需要关联到与 AudioTrack 相同的音频会话 ID(我认为它应该自动完成).

The AudioTrack doesn't need to be associated to same Audio session ID than AudioTrack (I suppose it should be done automatically).

这篇关于三星设备上的 AcousticEchoCanceler 不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆