peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 1 | /* |
| 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 Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #ifndef MODULES_AUDIO_PROCESSING_AEC3_ECHO_REMOVER_H_ |
| 12 | #define MODULES_AUDIO_PROCESSING_AEC3_ECHO_REMOVER_H_ |
peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 13 | |
| 14 | #include <vector> |
| 15 | |
Gustaf Ullberg | 3646f97 | 2018-02-14 15:19:04 +0100 | [diff] [blame] | 16 | #include "api/audio/echo_canceller3_config.h" |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 17 | #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" |
peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 21 | |
| 22 | namespace webrtc { |
| 23 | |
| 24 | // Class for removing the echo from the capture signal. |
| 25 | class EchoRemover { |
| 26 | public: |
Gustaf Ullberg | bd83b91 | 2017-10-18 12:32:42 +0200 | [diff] [blame] | 27 | static EchoRemover* Create(const EchoCanceller3Config& config, |
| 28 | int sample_rate_hz); |
peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 29 | virtual ~EchoRemover() = default; |
| 30 | |
Gustaf Ullberg | 332150d | 2017-11-22 14:17:39 +0100 | [diff] [blame] | 31 | // Get current metrics. |
| 32 | virtual void GetMetrics(EchoControl::Metrics* metrics) const = 0; |
| 33 | |
peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 34 | // 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. |
peah | cf02cf1 | 2017-04-05 14:18:07 -0700 | [diff] [blame] | 37 | virtual void ProcessCapture( |
peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 38 | const EchoPathVariability& echo_path_variability, |
| 39 | bool capture_signal_saturation, |
Per Ã…hgren | c59a576 | 2017-12-11 21:34:19 +0100 | [diff] [blame] | 40 | RenderBuffer* render_buffer, |
peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 41 | 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 Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 50 | #endif // MODULES_AUDIO_PROCESSING_AEC3_ECHO_REMOVER_H_ |