blob: 230ed985a9599a904c081be30f7e1973e8a9291e [file] [log] [blame]
peah69221db2017-01-27 03:28:19 -08001/*
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#ifndef MODULES_AUDIO_PROCESSING_AEC3_ECHO_REMOVER_H_
12#define MODULES_AUDIO_PROCESSING_AEC3_ECHO_REMOVER_H_
peah69221db2017-01-27 03:28:19 -080013
14#include <vector>
15
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020016#include "api/optional.h"
17#include "modules/audio_processing/aec3/echo_path_variability.h"
18#include "modules/audio_processing/aec3/render_buffer.h"
19#include "modules/audio_processing/include/audio_processing.h"
peah69221db2017-01-27 03:28:19 -080020
21namespace webrtc {
22
23// Class for removing the echo from the capture signal.
24class EchoRemover {
25 public:
Gustaf Ullbergbd83b912017-10-18 12:32:42 +020026 static EchoRemover* Create(const EchoCanceller3Config& config,
27 int sample_rate_hz);
peah69221db2017-01-27 03:28:19 -080028 virtual ~EchoRemover() = default;
29
Gustaf Ullberg332150d2017-11-22 14:17:39 +010030 // Get current metrics.
31 virtual void GetMetrics(EchoControl::Metrics* metrics) const = 0;
32
peah69221db2017-01-27 03:28:19 -080033 // Removes the echo from a block of samples from the capture signal. The
34 // supplied render signal is assumed to be pre-aligned with the capture
35 // signal.
peahcf02cf12017-04-05 14:18:07 -070036 virtual void ProcessCapture(
peah69221db2017-01-27 03:28:19 -080037 const rtc::Optional<size_t>& echo_path_delay_samples,
38 const EchoPathVariability& echo_path_variability,
39 bool capture_signal_saturation,
Per Ã…hgrenc59a5762017-12-11 21:34:19 +010040 RenderBuffer* render_buffer,
peah69221db2017-01-27 03:28:19 -080041 std::vector<std::vector<float>>* capture) = 0;
42
43 // Updates the status on whether echo leakage is detected in the output of the
44 // echo remover.
45 virtual void UpdateEchoLeakageStatus(bool leakage_detected) = 0;
46};
47
48} // namespace webrtc
49
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020050#endif // MODULES_AUDIO_PROCESSING_AEC3_ECHO_REMOVER_H_