Allow extracting the linear AEC output
This CL enables extracting the linear AEC output,
allowing for more straightforward
testing/development.
Bug: b/140823178
Change-Id: I14f7934008d87066b35500466cb6e6d96f811688
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153672
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29789}
diff --git a/modules/audio_processing/include/audio_processing.h b/modules/audio_processing/include/audio_processing.h
index f1242a7..113bd2a 100644
--- a/modules/audio_processing/include/audio_processing.h
+++ b/modules/audio_processing/include/audio_processing.h
@@ -280,6 +280,7 @@
bool legacy_moderate_suppression_level = false;
// Recommended not to use. Will be removed in the future.
bool use_legacy_aec = false;
+ bool export_linear_aec_output = false;
} echo_canceller;
// Enables background noise suppression.
@@ -611,6 +612,13 @@
virtual int AnalyzeReverseStream(const float* const* data,
const StreamConfig& reverse_config) = 0;
+ // Returns the most recently produced 10 ms of the linear AEC output at a rate
+ // of 16 kHz. If there is more than one capture channel, a mono representation
+ // of the input is returned. Returns true/false to indicate whether an output
+ // returned.
+ virtual bool GetLinearAecOutput(
+ rtc::ArrayView<std::array<float, 160>> linear_output) const = 0;
+
// This must be called prior to ProcessStream() if and only if adaptive analog
// gain control is enabled, to pass the current analog level from the audio
// HAL. Must be within the range provided in Config::GainController1.