| 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 CHROME_BROWSER_SPEECH_ENDPOINTER_ENDPOINTER_H_ | 5 #ifndef CHROME_BROWSER_SPEECH_ENDPOINTER_ENDPOINTER_H_ |
| 6 #define CHROME_BROWSER_SPEECH_ENDPOINTER_ENDPOINTER_H_ | 6 #define CHROME_BROWSER_SPEECH_ENDPOINTER_ENDPOINTER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "chrome/browser/speech/endpointer/energy_endpointer.h" | 9 #include "chrome/browser/speech/endpointer/energy_endpointer.h" |
| 10 | 10 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 // input, e.g. by pressing a button. | 58 // input, e.g. by pressing a button. |
| 59 void SetUserInputMode(); | 59 void SetUserInputMode(); |
| 60 | 60 |
| 61 // Process a segment of audio, which may be more than one frame. | 61 // Process a segment of audio, which may be more than one frame. |
| 62 // The status of the last frame will be returned. | 62 // The status of the last frame will be returned. |
| 63 EpStatus ProcessAudio(const int16* audio_data, int num_samples); | 63 EpStatus ProcessAudio(const int16* audio_data, int num_samples); |
| 64 | 64 |
| 65 // Get the status of the endpointer. | 65 // Get the status of the endpointer. |
| 66 EpStatus Status(int64 *time_us); | 66 EpStatus Status(int64 *time_us); |
| 67 | 67 |
| 68 // Returns true if the endpointer detected reasonable audio levels above |
| 69 // background noise which could be user speech, false if not. |
| 70 bool DidStartReceivingSpeech() const { |
| 71 return speech_previously_detected_; |
| 72 } |
| 73 |
| 74 bool IsEstimatingEnvironment() const { |
| 75 return energy_endpointer_.estimating_environment(); |
| 76 } |
| 77 |
| 68 void set_speech_input_complete_silence_length(int64 time_us) { | 78 void set_speech_input_complete_silence_length(int64 time_us) { |
| 69 speech_input_complete_silence_length_us_ = time_us; | 79 speech_input_complete_silence_length_us_ = time_us; |
| 70 } | 80 } |
| 71 | 81 |
| 72 void set_long_speech_input_complete_silence_length(int64 time_us) { | 82 void set_long_speech_input_complete_silence_length(int64 time_us) { |
| 73 long_speech_input_complete_silence_length_us_ = time_us; | 83 long_speech_input_complete_silence_length_us_ = time_us; |
| 74 } | 84 } |
| 75 | 85 |
| 76 void set_speech_input_possibly_complete_silence_length(int64 time_us) { | 86 void set_speech_input_possibly_complete_silence_length(int64 time_us) { |
| 77 speech_input_possibly_complete_silence_length_us_ = time_us; | 87 speech_input_possibly_complete_silence_length_us_ = time_us; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 bool speech_previously_detected_; | 138 bool speech_previously_detected_; |
| 129 bool speech_input_complete_; | 139 bool speech_input_complete_; |
| 130 EnergyEndpointer energy_endpointer_; | 140 EnergyEndpointer energy_endpointer_; |
| 131 int sample_rate_; | 141 int sample_rate_; |
| 132 int32 frame_size_; | 142 int32 frame_size_; |
| 133 }; | 143 }; |
| 134 | 144 |
| 135 } // namespace speech_input | 145 } // namespace speech_input |
| 136 | 146 |
| 137 #endif // CHROME_BROWSER_SPEECH_ENDPOINTER_ENDPOINTER_H_ | 147 #endif // CHROME_BROWSER_SPEECH_ENDPOINTER_ENDPOINTER_H_ |
| OLD | NEW |