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}
diff --git a/webrtc/modules/audio_processing/aec/aec_core.c b/webrtc/modules/audio_processing/aec/aec_core.c
index f540f94..4d59956 100644
--- a/webrtc/modules/audio_processing/aec/aec_core.c
+++ b/webrtc/modules/audio_processing/aec/aec_core.c
@@ -1607,10 +1607,11 @@
// 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;
}