| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CONTENT_BROWSER_SPEECH_ENDPOINTER_ENDPOINTER_H_ | 5 #ifndef CONTENT_BROWSER_SPEECH_ENDPOINTER_ENDPOINTER_H_ |
| 6 #define CONTENT_BROWSER_SPEECH_ENDPOINTER_ENDPOINTER_H_ | 6 #define CONTENT_BROWSER_SPEECH_ENDPOINTER_ENDPOINTER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "content/browser/speech/endpointer/energy_endpointer.h" | 9 #include "content/browser/speech/endpointer/energy_endpointer.h" |
| 10 | 10 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 } | 89 } |
| 90 | 90 |
| 91 void set_long_speech_length(int64 time_us) { | 91 void set_long_speech_length(int64 time_us) { |
| 92 long_speech_length_us_ = time_us; | 92 long_speech_length_us_ = time_us; |
| 93 } | 93 } |
| 94 | 94 |
| 95 bool speech_input_complete() const { | 95 bool speech_input_complete() const { |
| 96 return speech_input_complete_; | 96 return speech_input_complete_; |
| 97 } | 97 } |
| 98 | 98 |
| 99 // RMS background noise level in dB. |
| 100 float NoiseLevelDb() const { return energy_endpointer_.GetNoiseLevelDb(); } |
| 101 |
| 99 private: | 102 private: |
| 100 // Reset internal states. Helper method common to initial input utterance | 103 // Reset internal states. Helper method common to initial input utterance |
| 101 // and following input utternaces. | 104 // and following input utternaces. |
| 102 void Reset(); | 105 void Reset(); |
| 103 | 106 |
| 104 // Minimum allowable length of speech input. | 107 // Minimum allowable length of speech input. |
| 105 int64 speech_input_minimum_length_us_; | 108 int64 speech_input_minimum_length_us_; |
| 106 | 109 |
| 107 // The speechInputPossiblyComplete event signals that silence/noise has been | 110 // The speechInputPossiblyComplete event signals that silence/noise has been |
| 108 // detected for a *short* amount of time after some speech has been detected. | 111 // detected for a *short* amount of time after some speech has been detected. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 139 bool speech_previously_detected_; | 142 bool speech_previously_detected_; |
| 140 bool speech_input_complete_; | 143 bool speech_input_complete_; |
| 141 EnergyEndpointer energy_endpointer_; | 144 EnergyEndpointer energy_endpointer_; |
| 142 int sample_rate_; | 145 int sample_rate_; |
| 143 int32 frame_size_; | 146 int32 frame_size_; |
| 144 }; | 147 }; |
| 145 | 148 |
| 146 } // namespace speech_input | 149 } // namespace speech_input |
| 147 | 150 |
| 148 #endif // CONTENT_BROWSER_SPEECH_ENDPOINTER_ENDPOINTER_H_ | 151 #endif // CONTENT_BROWSER_SPEECH_ENDPOINTER_ENDPOINTER_H_ |
| OLD | NEW |