| 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_SPEECH_RECOGNIZER_H_ | 5 #ifndef CHROME_BROWSER_SPEECH_SPEECH_RECOGNIZER_H_ |
| 6 #define CHROME_BROWSER_SPEECH_SPEECH_RECOGNIZER_H_ | 6 #define CHROME_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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 // detecting silence in user input or if |StopRecording| was called. The | 44 // detecting silence in user input or if |StopRecording| was called. The |
| 45 // delegate has to wait until |DidCompleteRecognition| is invoked before | 45 // delegate has to wait until |DidCompleteRecognition| is invoked before |
| 46 // destroying the |SpeechRecognizer| object. | 46 // destroying the |SpeechRecognizer| object. |
| 47 virtual void DidCompleteRecording(int caller_id) = 0; | 47 virtual void DidCompleteRecording(int caller_id) = 0; |
| 48 | 48 |
| 49 // This is guaranteed to be the last method invoked in the recognition | 49 // This is guaranteed to be the last method invoked in the recognition |
| 50 // sequence and the |SpeechRecognizer| object can be freed up if necessary. | 50 // sequence and the |SpeechRecognizer| object can be freed up if necessary. |
| 51 virtual void DidCompleteRecognition(int caller_id) = 0; | 51 virtual void DidCompleteRecognition(int caller_id) = 0; |
| 52 | 52 |
| 53 // Invoked if there was an error while recording or recognizing audio. The | 53 // Invoked if there was an error while recording or recognizing audio. The |
| 54 // session is terminated when this call is made and the DidXxxx callbacks | 54 // session has already been cancelled when this call is made and the DidXxxx |
| 55 // are issued after this call. | 55 // callbacks will not be issued. It is safe to destroy/release the |
| 56 // |SpeechRecognizer| object while processing this call. |
| 56 virtual void OnRecognizerError(int caller_id, | 57 virtual void OnRecognizerError(int caller_id, |
| 57 SpeechRecognizer::ErrorCode error) = 0; | 58 SpeechRecognizer::ErrorCode error) = 0; |
| 58 | 59 |
| 59 // 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 |
| 60 // estimate the environment/background noise and this callback is issued | 61 // estimate the environment/background noise and this callback is issued |
| 61 // after that is complete. Typically the delegate brings up any speech | 62 // after that is complete. Typically the delegate brings up any speech |
| 62 // recognition UI once this callback is received. | 63 // recognition UI once this callback is received. |
| 63 virtual void DidCompleteEnvironmentEstimation(int caller_id) = 0; | 64 virtual void DidCompleteEnvironmentEstimation(int caller_id) = 0; |
| 64 | 65 |
| 65 protected: | 66 protected: |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 126 |
| 126 // This typedef is to workaround the issue with certain versions of | 127 // This typedef is to workaround the issue with certain versions of |
| 127 // Visual Studio where it gets confused between multiple Delegate | 128 // Visual Studio where it gets confused between multiple Delegate |
| 128 // classes and gives a C2500 error. (I saw this error on the try bots - | 129 // classes and gives a C2500 error. (I saw this error on the try bots - |
| 129 // the workaround was not needed for my machine). | 130 // the workaround was not needed for my machine). |
| 130 typedef SpeechRecognizer::Delegate SpeechRecognizerDelegate; | 131 typedef SpeechRecognizer::Delegate SpeechRecognizerDelegate; |
| 131 | 132 |
| 132 } // namespace speech_input | 133 } // namespace speech_input |
| 133 | 134 |
| 134 #endif // CHROME_BROWSER_SPEECH_SPEECH_RECOGNIZER_H_ | 135 #endif // CHROME_BROWSER_SPEECH_SPEECH_RECOGNIZER_H_ |
| OLD | NEW |