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

Side by Side Diff: content/browser/speech/endpointer/energy_endpointer.cc

Issue 266723015: Fix typo, "recieve" -> "receive", in content/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | content/child/npapi/plugin_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // To know more about the algorithm used and the original code which this is 5 // To know more about the algorithm used and the original code which this is
6 // based of, see 6 // based of, see
7 // https://wiki.corp.google.com/twiki/bin/view/Main/ChromeGoogleCodeXRef 7 // https://wiki.corp.google.com/twiki/bin/view/Main/ChromeGoogleCodeXRef
8 8
9 #include "content/browser/speech/endpointer/energy_endpointer.h" 9 #include "content/browser/speech/endpointer/energy_endpointer.h"
10 10
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 231
232 void EnergyEndpointer::ProcessAudioFrame(int64 time_us, 232 void EnergyEndpointer::ProcessAudioFrame(int64 time_us,
233 const int16* samples, 233 const int16* samples,
234 int num_samples, 234 int num_samples,
235 float* rms_out) { 235 float* rms_out) {
236 endpointer_time_us_ = time_us; 236 endpointer_time_us_ = time_us;
237 float rms = RMS(samples, num_samples); 237 float rms = RMS(samples, num_samples);
238 238
239 // Check that this is user input audio vs. pre-input adaptation audio. 239 // Check that this is user input audio vs. pre-input adaptation audio.
240 // Input audio starts when the user indicates start of input, by e.g. 240 // Input audio starts when the user indicates start of input, by e.g.
241 // pressing push-to-talk. Audio recieved prior to that is used to update 241 // pressing push-to-talk. Audio received prior to that is used to update
242 // noise and speech level estimates. 242 // noise and speech level estimates.
243 if (!estimating_environment_) { 243 if (!estimating_environment_) {
244 bool decision = false; 244 bool decision = false;
245 if ((endpointer_time_us_ - user_input_start_time_us_) < 245 if ((endpointer_time_us_ - user_input_start_time_us_) <
246 Secs2Usecs(params_.contamination_rejection_period())) { 246 Secs2Usecs(params_.contamination_rejection_period())) {
247 decision = false; 247 decision = false;
248 DVLOG(1) << "decision: forced to false, time: " << endpointer_time_us_; 248 DVLOG(1) << "decision: forced to false, time: " << endpointer_time_us_;
249 } else { 249 } else {
250 decision = (rms > decision_threshold_); 250 decision = (rms > decision_threshold_);
251 } 251 }
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 decision_threshold_ = params_.min_decision_threshold(); 367 decision_threshold_ = params_.min_decision_threshold();
368 } 368 }
369 } 369 }
370 370
371 EpStatus EnergyEndpointer::Status(int64* status_time) const { 371 EpStatus EnergyEndpointer::Status(int64* status_time) const {
372 *status_time = history_->EndTime(); 372 *status_time = history_->EndTime();
373 return status_; 373 return status_;
374 } 374 }
375 375
376 } // namespace content 376 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/child/npapi/plugin_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698