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

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

Issue 9568002: Renamed speech input implementation from to speech_recognition_*. The namespace has been renamed fr… (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebased from master. Created 8 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
OLDNEW
1 // Copyright (c) 2010 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
11 #include <math.h> 11 #include <math.h>
(...skipping 22 matching lines...) Expand all
34 } 34 }
35 35
36 float GetDecibel(float value) { 36 float GetDecibel(float value) {
37 if (value > 1.0e-100) 37 if (value > 1.0e-100)
38 return 20 * log10(value); 38 return 20 * log10(value);
39 return -2000.0; 39 return -2000.0;
40 } 40 }
41 41
42 } // namespace 42 } // namespace
43 43
44 namespace speech_input { 44 namespace speech {
45 45
46 // Stores threshold-crossing histories for making decisions about the speech 46 // Stores threshold-crossing histories for making decisions about the speech
47 // state. 47 // state.
48 class EnergyEndpointer::HistoryRing { 48 class EnergyEndpointer::HistoryRing {
49 public: 49 public:
50 HistoryRing() : insertion_index_(0) {} 50 HistoryRing() : insertion_index_(0) {}
51 51
52 // Resets the ring to |size| elements each with state |initial_state| 52 // Resets the ring to |size| elements each with state |initial_state|
53 void SetRing(int size, bool initial_state); 53 void SetRing(int size, bool initial_state);
54 54
(...skipping 312 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 speech 376 } // namespace speech
OLDNEW
« no previous file with comments | « content/browser/speech/endpointer/energy_endpointer.h ('k') | content/browser/speech/endpointer/energy_endpointer_params.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698