OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/media/media_stream_audio_processor_options.h" | 5 #include "content/renderer/media/media_stream_audio_processor_options.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 CHECK_EQ(audio_processing->high_pass_filter()->Enable(true), 0); | 127 CHECK_EQ(audio_processing->high_pass_filter()->Enable(true), 0); |
128 } | 128 } |
129 | 129 |
130 void EnableTypingDetection(AudioProcessing* audio_processing, | 130 void EnableTypingDetection(AudioProcessing* audio_processing, |
131 webrtc::TypingDetection* typing_detector) { | 131 webrtc::TypingDetection* typing_detector) { |
132 int err = audio_processing->voice_detection()->Enable(true); | 132 int err = audio_processing->voice_detection()->Enable(true); |
133 err |= audio_processing->voice_detection()->set_likelihood( | 133 err |= audio_processing->voice_detection()->set_likelihood( |
134 webrtc::VoiceDetection::kVeryLowLikelihood); | 134 webrtc::VoiceDetection::kVeryLowLikelihood); |
135 CHECK_EQ(err, 0); | 135 CHECK_EQ(err, 0); |
136 | 136 |
137 // Configure the update period to 100ms (10 * 10ms) in the typing detector. | 137 // Configure the update period to 1s (100 * 10ms) in the typing detector. |
138 typing_detector->SetParameters(0, 0, 0, 0, 0, 10); | 138 typing_detector->SetParameters(0, 0, 0, 0, 0, 100); |
139 } | 139 } |
140 | 140 |
141 void EnableExperimentalEchoCancellation(AudioProcessing* audio_processing) { | 141 void EnableExperimentalEchoCancellation(AudioProcessing* audio_processing) { |
142 webrtc::Config config; | 142 webrtc::Config config; |
143 config.Set<webrtc::DelayCorrection>(new webrtc::DelayCorrection(true)); | 143 config.Set<webrtc::DelayCorrection>(new webrtc::DelayCorrection(true)); |
144 audio_processing->SetExtraOptions(config); | 144 audio_processing->SetExtraOptions(config); |
145 } | 145 } |
146 | 146 |
147 void StartEchoCancellationDump(AudioProcessing* audio_processing, | 147 void StartEchoCancellationDump(AudioProcessing* audio_processing, |
148 const base::PlatformFile& aec_dump_file) { | 148 const base::PlatformFile& aec_dump_file) { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 } | 207 } |
208 | 208 |
209 int median = 0, std = 0; | 209 int median = 0, std = 0; |
210 if (!audio_processing->echo_cancellation()->GetDelayMetrics(&median, &std)) { | 210 if (!audio_processing->echo_cancellation()->GetDelayMetrics(&median, &std)) { |
211 stats->echo_delay_median_ms = median; | 211 stats->echo_delay_median_ms = median; |
212 stats->echo_delay_std_ms = std; | 212 stats->echo_delay_std_ms = std; |
213 } | 213 } |
214 } | 214 } |
215 | 215 |
216 } // namespace content | 216 } // namespace content |
OLD | NEW |