blob: 8e5663cbb175e4f9ecb393ff333bbefb02f08040 [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
Gustaf Ullberg3646f972018-02-14 15:19:04 +010016#include "api/audio/echo_canceller3_config.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020017#include "api/optional.h"
18#include "modules/audio_processing/aec3/echo_path_variability.h"
19#include "modules/audio_processing/aec3/render_buffer.h"
20#include "modules/audio_processing/include/audio_processing.h"
peah69221db2017-01-27 03:28:19 -080021
22namespace webrtc {
23
24// Class for removing the echo from the capture signal.
25class EchoRemover {
26 public:
Gustaf Ullbergbd83b912017-10-18 12:32:42 +020027 static EchoRemover* Create(const EchoCanceller3Config& config,
28 int sample_rate_hz);
peah69221db2017-01-27 03:28:19 -080029 virtual ~EchoRemover() = default;
30
Gustaf Ullberg332150d2017-11-22 14:17:39 +010031 // Get current metrics.
32 virtual void GetMetrics(EchoControl::Metrics* metrics) const = 0;
33
peah69221db2017-01-27 03:28:19 -080034 // Removes the echo from a block of samples from the capture signal. The
35 // supplied render signal is assumed to be pre-aligned with the capture
36 // signal.
peahcf02cf12017-04-05 14:18:07 -070037 virtual void ProcessCapture(
peah69221db2017-01-27 03:28:19 -080038 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_