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 // The EnergyEndpointer class finds likely speech onset and offset points. | 5 // The EnergyEndpointer class finds likely speech onset and offset points. |
6 // | 6 // |
7 // The implementation described here is about the simplest possible. | 7 // The implementation described here is about the simplest possible. |
8 // It is based on timings of threshold crossings for overall signal | 8 // It is based on timings of threshold crossings for overall signal |
9 // RMS. It is suitable for light weight applications. | 9 // RMS. It is suitable for light weight applications. |
10 // | 10 // |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 float* rms_out); | 84 float* rms_out); |
85 | 85 |
86 // Returns the current state of the EnergyEndpointer and the time | 86 // Returns the current state of the EnergyEndpointer and the time |
87 // corresponding to the most recently computed frame. | 87 // corresponding to the most recently computed frame. |
88 EpStatus Status(int64* status_time_us) const; | 88 EpStatus Status(int64* status_time_us) const; |
89 | 89 |
90 bool estimating_environment() const { | 90 bool estimating_environment() const { |
91 return estimating_environment_; | 91 return estimating_environment_; |
92 } | 92 } |
93 | 93 |
| 94 // Returns estimated noise level in dB. |
| 95 float GetNoiseLevelDb() const; |
| 96 |
94 private: | 97 private: |
95 class HistoryRing; | 98 class HistoryRing; |
96 | 99 |
97 // Resets the endpointer internal state. If reset_threshold is true, the | 100 // Resets the endpointer internal state. If reset_threshold is true, the |
98 // state will be reset completely, including adaptive thresholds and the | 101 // state will be reset completely, including adaptive thresholds and the |
99 // removal of all history information. | 102 // removal of all history information. |
100 void Restart(bool reset_threshold); | 103 void Restart(bool reset_threshold); |
101 | 104 |
102 // Update internal speech and noise levels. | 105 // Update internal speech and noise levels. |
103 void UpdateLevels(float rms); | 106 void UpdateLevels(float rms); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 // Time when mode switched from environment estimation to user input. This | 145 // Time when mode switched from environment estimation to user input. This |
143 // is used to time forced rejection of audio feedback contamination. | 146 // is used to time forced rejection of audio feedback contamination. |
144 int64 user_input_start_time_us_; | 147 int64 user_input_start_time_us_; |
145 | 148 |
146 DISALLOW_COPY_AND_ASSIGN(EnergyEndpointer); | 149 DISALLOW_COPY_AND_ASSIGN(EnergyEndpointer); |
147 }; | 150 }; |
148 | 151 |
149 } // namespace speech_input | 152 } // namespace speech_input |
150 | 153 |
151 #endif // CONTENT_BROWSER_SPEECH_ENDPOINTER_ENERGY_ENDPOINTER_H_ | 154 #endif // CONTENT_BROWSER_SPEECH_ENDPOINTER_ENERGY_ENDPOINTER_H_ |
OLD | NEW |