gpt4 book ai didi

c++ - WebRtc Acoustic Echo Cancellation3 (AEC3) 在回声消除后提供平坦的 MicOutPut

转载 作者:行者123 更新时间:2023-12-01 14:50:20 43 4
gpt4 key购买 nike

让我开始这个话题,声明我是 WebRtc 的新手,如果我提到任何半诙谐的话,请耐心等待一种可以原谅的方式。

我正在编写一个应用程序,用于比较 Speex 和 Web RTC AEC3 之间的回声消除性能。[WebRtc AEC3代码库(最新分支):https://webrtc.googlesource.com/src/+/branch-heads/72]

应用程序读取 WAV 文件并将样本提供给 AEC 模块,WAV 编写器保存回声消除的输出,

我有两个输入:1) 扬声器输入或渲染信号或远端信号2) MicInput or Captured Signal or NearEnd Signal

还有一个输出:1) MicOutput- 回声消除的结果。

现在对于 Speex 模块,我看到了一种行为良好的方式。请查看以下文件,它在取消渲染信号方面做得很好捕获的信号。

Speex Results

但是,当我使用 WebRtc Aec3 传递相同的文件时,我收到了一个平坦的信号。下面是AEC3的结果。

WebRtc AEC3 Results

它似乎也在抵消原始麦克风信号。

我正在使用以下参数(从 Wav 文件阅读器中提取):采样率:8000 channel : 1位/样本:16 sample 数量:270399一次送入 AEC 的样本数:(10 * SampleRate)/1000 = 80

这是初始化:

m_streamConfig.set_sample_rate_hz(sampleRate);
m_streamConfig.set_num_channels(CHANNEL_COUNT);

// Create a temporary buffer to convert our RTOP input audio data into the webRTC required AudioBuffer.
m_tempBuffer[0] = static_cast<float*> (malloc(sizeof(float) * m_samplesPerBlock));

// Create AEC3.
m_echoCanceller3.reset(new EchoCanceller3(m_echoCanceller3Config, sampleRate, true)); //use high pass filter is true

// Create noise suppression.
m_noiseSuppression.reset(new NoiseSuppressionImpl(&m_criticalSection));
m_noiseSuppression->Initialize(CHANNEL_COUNT, sampleRate);

这就是我调用 API 的方式:

auto renderAudioBuffer = CreateAudioBuffer(spkSamples);
auto capturedAudioBuffer = CreateAudioBuffer(micSamples);

// Analyze capture buffer
m_echoCanceller3->AnalyzeCapture(capturedAudioBuffer.get());

// Analyze render buffer
m_echoCanceller3->AnalyzeRender(renderAudioBuffer.get());

// Cancel echo
m_echoCanceller3->ProcessCapture(
capturedAudioBuffer.get(), false);
// Assuming the analog level is not changed.
//If we want to detect change, need to use gain controller and remember the previously rendered audio's analog level

// Copy the Captured audio out
capturedAudioBuffer->CopyTo(m_streamConfig, m_tempBuffer);

arrayCopy_32f(m_tempBuffer[0], micOut, m_samplesPerBlock);

还有关于参数(delay、echoModel、reverb、noisefloor 等),我使用所有默认值。

谁能告诉我我做错了什么?或者如何通过调整合适的参数让它变得更好?

更新日期:(02/22/2019)找出为什么回声输出静音。似乎 Webrtc AEC3 无法处理 8k 和 16k 采样率,尽管在源代码中有迹象表明它们支持 4 种不同的采样率:8k、16k、32k 和 48k。在输入 32k 和 48k 样本后,我得到了回声消除输出。但是,我没有看到任何回声消除。它只是在为 NearEnd/Mic/Captured 输入输入时吐出准确的样本。是的,可能我缺少关键参数设置。仍在寻求帮助。

最佳答案

  1. 音频缓冲区

最重要的是“delay”这个东西,你可以在audio_processing.h中找到它的定义

设置|延迟|在接收远端的 ProcessReverseStream() 之间的毫秒数frame 和 ProcessStream() 接收包含的近端帧相应的回声。在客户端,这可以表示为延迟 = (t_render - t_analyze) + (t_process - t_capture)在哪里,

 - t_analyze is the time a frame is passed to ProcessReverseStream() and
t_render is the time the first sample of the same frame is rendered by
the audio hardware.
- t_capture is the time the first sample of a frame is captured by the
audio hardware and t_process is the time the same frame is passed to
ProcessStream().

2。 EchoCanceller3 延迟

SetAudioBufferDelay(int dealy);

关于c++ - WebRtc Acoustic Echo Cancellation3 (AEC3) 在回声消除后提供平坦的 MicOutPut,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54717086/

43 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com