OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright (c) 2016 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 #include "webrtc/modules/audio_processing/aec3/echo_canceller3.h" | |
11 | |
12 #include "webrtc/system_wrappers/include/logging.h" | |
13 | |
14 namespace webrtc { | |
15 | |
16 int EchoCanceller3::instance_count_ = 0; | |
17 | |
18 EchoCanceller3::EchoCanceller3(int sample_rate_hz, bool use_anti_hum_filter) { | |
19 int band_sample_rate_hz = (sample_rate_hz == 8000 ? sample_rate_hz : 16000); | |
20 frame_length_ = rtc::CheckedDivExact(band_sample_rate_hz, 100); | |
21 | |
22 LOG(LS_INFO) << "AEC3 created : " | |
23 << "{ instance_count: " << instance_count_ << "}"; | |
24 ++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
| |
25 } | |
26 | |
27 EchoCanceller3::~EchoCanceller3() = default; | |
28 | |
29 bool EchoCanceller3::AnalyzeRender(AudioBuffer* render) const { | |
30 RTC_DCHECK_EQ(1u, render->num_channels()); | |
31 RTC_DCHECK_EQ(frame_length_, render->num_frames_per_band()); | |
32 return true; | |
33 } | |
34 | |
35 void EchoCanceller3::AnalyzeCapture(AudioBuffer* capture) {} | |
36 | |
37 void EchoCanceller3::ProcessCapture(AudioBuffer* capture, | |
38 bool known_echo_path_change) { | |
39 RTC_DCHECK_EQ(1u, capture->num_channels()); | |
40 RTC_DCHECK_EQ(frame_length_, capture->num_frames_per_band()); | |
41 } | |
42 | |
43 std::string EchoCanceller3::ToString( | |
44 const AudioProcessing::Config::EchoCanceller3& config) { | |
45 std::stringstream ss; | |
46 ss << "{" | |
47 << "enabled: " << (config.enabled ? "true" : "false") << "}"; | |
48 return ss.str(); | |
49 } | |
50 | |
51 bool EchoCanceller3::Validate( | |
52 const AudioProcessing::Config::EchoCanceller3& config) { | |
53 return true; | |
54 } | |
55 | |
56 } // namespace webrtc | |
OLD | NEW |