Index: webrtc/modules/audio_processing/aec3/echo_canceller3.cc |
diff --git a/webrtc/modules/audio_processing/aec3/echo_canceller3.cc b/webrtc/modules/audio_processing/aec3/echo_canceller3.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c8ba2eb72c12225a03cc32a39fba7fc95b395b1c |
--- /dev/null |
+++ b/webrtc/modules/audio_processing/aec3/echo_canceller3.cc |
@@ -0,0 +1,56 @@ |
+/* |
+ * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
+ * |
+ * Use of this source code is governed by a BSD-style license |
+ * that can be found in the LICENSE file in the root of the source |
+ * tree. An additional intellectual property rights grant can be found |
+ * in the file PATENTS. All contributing project authors may |
+ * be found in the AUTHORS file in the root of the source tree. |
+ */ |
+#include "webrtc/modules/audio_processing/aec3/echo_canceller3.h" |
+ |
+#include "webrtc/system_wrappers/include/logging.h" |
+ |
+namespace webrtc { |
+ |
+int EchoCanceller3::instance_count_ = 0; |
+ |
+EchoCanceller3::EchoCanceller3(int sample_rate_hz, bool use_anti_hum_filter) { |
+ int band_sample_rate_hz = (sample_rate_hz == 8000 ? sample_rate_hz : 16000); |
+ frame_length_ = rtc::CheckedDivExact(band_sample_rate_hz, 100); |
+ |
+ LOG(LS_INFO) << "AEC3 created : " |
+ << "{ instance_count: " << instance_count_ << "}"; |
+ ++instance_count_; |
ivoc
2016/12/09 14:11:09
Not sure if this is a concern in practice, but thi
peah-webrtc
2016/12/12 19:46:45
Great point! It is only used in offline simulation
ivoc
2016/12/14 08:54:15
Let's keep it like this.
peah-webrtc
2016/12/14 08:56:16
I ended up changing it to using an atomic operatio
|
+} |
+ |
+EchoCanceller3::~EchoCanceller3() = default; |
+ |
+bool EchoCanceller3::AnalyzeRender(AudioBuffer* render) const { |
+ RTC_DCHECK_EQ(1u, render->num_channels()); |
+ RTC_DCHECK_EQ(frame_length_, render->num_frames_per_band()); |
+ return true; |
+} |
+ |
+void EchoCanceller3::AnalyzeCapture(AudioBuffer* capture) {} |
+ |
+void EchoCanceller3::ProcessCapture(AudioBuffer* capture, |
+ bool known_echo_path_change) { |
+ RTC_DCHECK_EQ(1u, capture->num_channels()); |
+ RTC_DCHECK_EQ(frame_length_, capture->num_frames_per_band()); |
+} |
+ |
+std::string EchoCanceller3::ToString( |
+ const AudioProcessing::Config::EchoCanceller3& config) { |
+ std::stringstream ss; |
+ ss << "{" |
+ << "enabled: " << (config.enabled ? "true" : "false") << "}"; |
+ return ss.str(); |
+} |
+ |
+bool EchoCanceller3::Validate( |
+ const AudioProcessing::Config::EchoCanceller3& config) { |
+ return true; |
+} |
+ |
+} // namespace webrtc |