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

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

Issue 6597071: Add a noise indicator to the speech bubble volume indicator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed all review comments. Created 9 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 | Annotate | Revision Log
OLDNEW
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
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698