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_SPEECH_RECOGNIZER_H_ | 5 #ifndef CONTENT_BROWSER_SPEECH_SPEECH_RECOGNIZER_H_ |
6 #define CONTENT_BROWSER_SPEECH_SPEECH_RECOGNIZER_H_ | 6 #define CONTENT_BROWSER_SPEECH_SPEECH_RECOGNIZER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 SpeechRecognizer::ErrorCode error) = 0; | 58 SpeechRecognizer::ErrorCode error) = 0; |
59 | 59 |
60 // At the start of recognition, a short amount of audio is recorded to | 60 // At the start of recognition, a short amount of audio is recorded to |
61 // estimate the environment/background noise and this callback is issued | 61 // estimate the environment/background noise and this callback is issued |
62 // after that is complete. Typically the delegate brings up any speech | 62 // after that is complete. Typically the delegate brings up any speech |
63 // recognition UI once this callback is received. | 63 // recognition UI once this callback is received. |
64 virtual void DidCompleteEnvironmentEstimation(int caller_id) = 0; | 64 virtual void DidCompleteEnvironmentEstimation(int caller_id) = 0; |
65 | 65 |
66 // Informs of a change in the captured audio level, useful if displaying | 66 // Informs of a change in the captured audio level, useful if displaying |
67 // a microphone volume indicator while recording. | 67 // a microphone volume indicator while recording. |
68 // The value of |volume| is in the [0.0, 1.0] range. | 68 // The value of |volume| and |noise_volume| is in the [0.0, 1.0] range. |
69 virtual void SetInputVolume(int caller_id, float volume) = 0; | 69 virtual void SetInputVolume(int caller_id, float volume, |
| 70 float noise_volume) = 0; |
70 | 71 |
71 protected: | 72 protected: |
72 virtual ~Delegate() {} | 73 virtual ~Delegate() {} |
73 }; | 74 }; |
74 | 75 |
75 SpeechRecognizer(Delegate* delegate, | 76 SpeechRecognizer(Delegate* delegate, |
76 int caller_id, | 77 int caller_id, |
77 const std::string& language, | 78 const std::string& language, |
78 const std::string& grammar, | 79 const std::string& grammar, |
79 const std::string& hardware_info, | 80 const std::string& hardware_info, |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 | 143 |
143 // This typedef is to workaround the issue with certain versions of | 144 // This typedef is to workaround the issue with certain versions of |
144 // Visual Studio where it gets confused between multiple Delegate | 145 // Visual Studio where it gets confused between multiple Delegate |
145 // classes and gives a C2500 error. (I saw this error on the try bots - | 146 // classes and gives a C2500 error. (I saw this error on the try bots - |
146 // the workaround was not needed for my machine). | 147 // the workaround was not needed for my machine). |
147 typedef SpeechRecognizer::Delegate SpeechRecognizerDelegate; | 148 typedef SpeechRecognizer::Delegate SpeechRecognizerDelegate; |
148 | 149 |
149 } // namespace speech_input | 150 } // namespace speech_input |
150 | 151 |
151 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNIZER_H_ | 152 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNIZER_H_ |
OLD | NEW |