Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(615)

Side by Side Diff: content/renderer/media/media_stream_audio_processor_options.cc

Issue 200223002: Increase the time window to 1 second for Typing Detection (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698