【问题标题】:Any acoustic echo cancellation (AEC) library capable of 48 kHz?任何能够达到 48 kHz 的声学回声消除 (AEC) 库?
【发布时间】:2017-02-18 22:12:15
【问题描述】:

我正在开发一个以 48 kHz 采样率运行的 VoIP 应用程序。由于它使用内部使用 48 kHz 的 Opus 作为其编解码器,并且大多数当前的 Android 硬件本机以 48 kHz 运行,因此 AEC 是我现在缺少的唯一难题。我已经找到了 WebRTC 实现,但我似乎无法弄清楚如何让它工作。看起来它会随机破坏内存并迟早使整个事情崩溃。当它不崩溃时,声音有点厚实,好像它在一半的帧中更安静。这是我处理 20 毫秒帧的代码:

webrtc::SplittingFilter* splittingFilter;
webrtc::IFChannelBuffer* bufferIn;
webrtc::IFChannelBuffer* bufferOut;
webrtc::IFChannelBuffer* bufferOut2;
// ...
splittingFilter=new webrtc::SplittingFilter(1, 3, 960);
bufferIn=new webrtc::IFChannelBuffer(960, 1, 1);
bufferOut=new webrtc::IFChannelBuffer(960, 1, 3);
bufferOut2=new webrtc::IFChannelBuffer(960, 1, 3);
// ...
int16_t* samples=(int16_t*)data;
float* fsamples[3];
float* foutput[3];
int i;
float* fbuf=bufferIn->fbuf()->bands(0)[0];
// convert the data from 16-bit PCM into float
for(i=0;i<960;i++){
    fbuf[i]=samples[i]/(float)32767;
}
// split it into three "bands" that the AEC needs and for some reason can't do itself
splittingFilter->Analysis(bufferIn, bufferOut);
// split the frame into 6 consecutive 160-sample blocks and perform AEC on them
for(i=0;i<6;i++){
    fsamples[0]=&bufferOut->fbuf()->bands(0)[0][160*i];
    fsamples[1]=&bufferOut->fbuf()->bands(0)[1][160*i];
    fsamples[2]=&bufferOut->fbuf()->bands(0)[2][160*i];
    foutput[0]=&bufferOut2->fbuf()->bands(0)[0][160*i];
    foutput[1]=&bufferOut2->fbuf()->bands(0)[1][160*i];
    foutput[2]=&bufferOut2->fbuf()->bands(0)[2][160*i];
    int32_t res=WebRtcAec_Process(aecState, (const float* const*) fsamples, 3, foutput, 160, 20, 0);
}
// put the "bands" back together
splittingFilter->Synthesis(bufferOut2, bufferIn);
// convert the processed data back into 16-bit PCM
for(i=0;i<960;i++){
    samples[i]=(int16_t) (CLAMP(fbuf[i], -1, 1)*32767);
}

如果我注释掉实际的回声消除,只进行浮点转换和来回分割,它不会破坏内存,听起来不会很奇怪并且可以无限期地运行。 (我确实将远端/扬声器信号传递给 AEC,我只是不想通过将其包含在问题中而弄乱我的代码)

我也尝试过 Android 的内置 AEC。虽然它确实有效,但它会从 16 kHz 对捕获的信号进行上采样。

【问题讨论】:

  • 致那些投票结束的人:这并不是说我不知道​​所有其他 VoIP 实现都使用“为语音提供足够带宽”的较低采样率。我只是认为是时候继续前进了,因为我们拥有更强大的硬件和更有效的编解码器。

标签: android c++ signal-processing aec


【解决方案1】:

很遗憾,没有支持 48khz 的免费 AEC 包。因此,要么移动到 32khz,要么使用 48khz 的商业 AEC 包。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-09-20
    • 1970-01-01
    • 2012-07-05
    相关资源
    最近更新 更多