OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PUBLIC_BROWSER_SPEECH_RECOGNIZER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNIZER_H_ |
6 #define CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNIZER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNIZER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 const std::string& hardware_info, | 39 const std::string& hardware_info, |
40 const std::string& origin_url); | 40 const std::string& origin_url); |
41 | 41 |
42 virtual ~SpeechRecognizer() {} | 42 virtual ~SpeechRecognizer() {} |
43 | 43 |
44 // Starts audio recording and the recognition process. The same | 44 // Starts audio recording and the recognition process. The same |
45 // SpeechRecognizer instance can be used multiple times for speech recognition | 45 // SpeechRecognizer instance can be used multiple times for speech recognition |
46 // though each recognition request can be made only after the previous one | 46 // though each recognition request can be made only after the previous one |
47 // completes (i.e. after receiving | 47 // completes (i.e. after receiving |
48 // SpeechRecognitionEventListener::OnRecognitionEnd). | 48 // SpeechRecognitionEventListener::OnRecognitionEnd). |
49 virtual bool StartRecognition() = 0; | 49 virtual void StartRecognition() = 0; |
50 | 50 |
51 // Stops recording audio and cancels recognition. Any audio recorded so far | 51 // Stops recording audio and cancels recognition. Any audio recorded so far |
52 // gets discarded. | 52 // gets discarded. |
53 virtual void AbortRecognition() = 0; | 53 virtual void AbortRecognition() = 0; |
54 | 54 |
55 // Stops recording audio and finalizes recognition, possibly getting results. | 55 // Stops recording audio and finalizes recognition, possibly getting results. |
56 virtual void StopAudioCapture() = 0; | 56 virtual void StopAudioCapture() = 0; |
57 | 57 |
58 // Checks wether the recognizer is active, that is, either capturing audio | 58 // Checks wether the recognizer is active, that is, either capturing audio |
59 // or waiting for a result. | 59 // or waiting for a result. |
60 virtual bool IsActive() const = 0; | 60 virtual bool IsActive() const = 0; |
61 | 61 |
62 // Checks wether the recognizer is capturing audio. | 62 // Checks wether the recognizer is capturing audio. |
63 virtual bool IsCapturingAudio() const = 0; | 63 virtual bool IsCapturingAudio() const = 0; |
64 }; | 64 }; |
65 | 65 |
66 } // namespace content | 66 } // namespace content |
67 | 67 |
68 #endif // CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNIZER_H_ | 68 #endif // CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNIZER_H_ |
OLD | NEW |