天天看點

WebRTC回聲消除算法在Android平台上的應用WebRTC回聲消除算法在Android平台上的應用

WebRTC回聲消除算法在Android平台上的應用

  • WebRTC的回聲消除算法包括AEC、AECM(即AEC Mobile)。使用AEC時,可以啟用估計延時不确定性(Delay Agnostic)的DA-AEC算法。
  • 在Android裝置上,我嘗試了DA-AEC。

    DA-AEC正确工作時,回聲消除效果很明顯,但不正确工作時,就有回聲消除不掉的情況了。

在查找過程中,發現了chrome bug系統中關于Android上回聲消除的一個提問及回報。當時是2017年上半年,連結如下:

https://bugs.chromium.org/p/webrtc/issues/detail?id=7291

提問者的應用場景是這樣的:

The Android device I used is a hardware device build by us running Android 5.1 on Rockchip RK3288. The device connects to a TV via HDMI, so it uses the TV speakers for audio output, and in-device mic for input. That is also the reason that I am using “googDAEchoCancellation”, since TV and the position of speakers to mic is relative, so the delay between the reference audio and the input with the echo is different based on the configuration used.

翻譯:我用的安卓裝置是自己做的,在Rockchip RK3288上運作的Adroid 5.1系統。裝置通過HDMI連接配接到電視,使用電視揚聲器作輸出,使用内置麥克作輸入。使用DA-AEC的原因是電視揚聲器與麥克之間的位置是相對(不固定)的,參考聲音信号與帶回聲的輸入信号間的延時就會随着實際擺放位置不同而不同。

先有這樣的回答:

The setup you are describing sounds like a very difficult setup for the AEC in that it uses different clocks for the playout (TV-set) and for the capture (in-device MIC) which means that there is clock-drift.

翻譯:你描述的場景對AEC來說聽起來很難,因為播放端(電視)和采集端(内置麥克)用不同的時鐘,意味着會有時鐘偏移。

後來的回答是這樣的:

From an AEC perspective I would say that you are running an AEC mode which we don’t use in native builds on Android platforms, and which I therefore doesn’t really have any good suggestions how to get to work. My recommendation is to use the WebRTC AEC mobile (AECM) instead which is the AEC that is used by default when running native on Android.

翻譯:從AEC的角度看,我要說你所用的AEC模式不是我們在安卓平台原生程式中使用的模式,我是以就沒有什麼來使它正常運作的建議了。我建議使用WebRTC AEC Moblie (AECM),這是安卓上運作原生程式時預設使用的AEC算法。

Android平台上移植使用WebRTC回聲消除算法的話,要使用AECM。DA-AEC可以嘗試,但不是任何時候都能有理想消除效果的。