From 3cfa756f371ffdcc0369d745e9832cfff55861ba Mon Sep 17 00:00:00 2001 From: Bjorn Volcker Date: Wed, 29 Apr 2015 20:22:44 +0200 Subject: [PATCH] audio_processing/aec: Fixes an incorrect sampling rate multiplier when processing in 48 kHz In AEC a fixed fft size is used, but processing can in the lower band be in either 8 or 16 kHz. Therefore we need a multiplier/rate factor to, for example, map frequency bands in Hz to frequency bins. The multiplier/rate factor can only be either 1 or 2, but when 48 kHz support was added it was assigned 3. BUG=crbug.com/482424 R=aluebs@webrtc.org Review URL: https://webrtc-codereview.appspot.com/43329004 Cr-Commit-Position: refs/heads/master@{#9117} --- webrtc/modules/audio_processing/aec/aec_core.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/webrtc/modules/audio_processing/aec/aec_core.c b/webrtc/modules/audio_processing/aec/aec_core.c index f540f9428d..4d59956dc8 100644 --- a/webrtc/modules/audio_processing/aec/aec_core.c +++ b/webrtc/modules/audio_processing/aec/aec_core.c @@ -1607,10 +1607,11 @@ int WebRtcAec_InitAec(AecCore* aec, int sampFreq) { // Default target suppression mode. aec->nlp_mode = 1; - // Sampling frequency multiplier - // SWB is processed as 160 frame size + // Sampling frequency multiplier w.r.t. 8 kHz. + // In case of multiple bands we process the lower band in 16 kHz, hence the + // multiplier is always 2. if (aec->num_bands > 1) { - aec->mult = (short)aec->sampFreq / 16000; + aec->mult = 2; } else { aec->mult = (short)aec->sampFreq / 8000; }