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_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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 namespace speech { | 26 namespace speech { |
27 // Handles speech recognition for a session (identified by |session_id|), taking | 27 // Handles speech recognition for a session (identified by |session_id|), taking |
28 // care of audio capture, silence detection/endpointer and interaction with the | 28 // care of audio capture, silence detection/endpointer and interaction with the |
29 // SpeechRecognitionEngine. | 29 // SpeechRecognitionEngine. |
30 class CONTENT_EXPORT SpeechRecognizer | 30 class CONTENT_EXPORT SpeechRecognizer |
31 : public base::RefCountedThreadSafe<SpeechRecognizer>, | 31 : public base::RefCountedThreadSafe<SpeechRecognizer>, |
32 public media::AudioInputController::EventHandler, | 32 public media::AudioInputController::EventHandler, |
33 public NON_EXPORTED_BASE(SpeechRecognitionEngineDelegate) { | 33 public NON_EXPORTED_BASE(SpeechRecognitionEngineDelegate) { |
34 public: | 34 public: |
35 static const int kAudioSampleRate; | 35 static const int kAudioSampleRate; |
36 static const ChannelLayout kChannelLayout; | 36 static const media::ChannelLayout kChannelLayout; |
37 static const int kNumBitsPerAudioSample; | 37 static const int kNumBitsPerAudioSample; |
38 static const int kNoSpeechTimeoutMs; | 38 static const int kNoSpeechTimeoutMs; |
39 static const int kEndpointerEstimationTimeMs; | 39 static const int kEndpointerEstimationTimeMs; |
40 | 40 |
41 static void SetAudioManagerForTests(media::AudioManager* audio_manager); | 41 static void SetAudioManagerForTests(media::AudioManager* audio_manager); |
42 | 42 |
43 SpeechRecognizer( | 43 SpeechRecognizer( |
44 content::SpeechRecognitionEventListener* listener, | 44 content::SpeechRecognitionEventListener* listener, |
45 int session_id, | 45 int session_id, |
46 bool is_single_shot, | 46 bool is_single_shot, |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 bool is_dispatching_event_; | 154 bool is_dispatching_event_; |
155 bool is_single_shot_; | 155 bool is_single_shot_; |
156 FSMState state_; | 156 FSMState state_; |
157 | 157 |
158 DISALLOW_COPY_AND_ASSIGN(SpeechRecognizer); | 158 DISALLOW_COPY_AND_ASSIGN(SpeechRecognizer); |
159 }; | 159 }; |
160 | 160 |
161 } // namespace speech | 161 } // namespace speech |
162 | 162 |
163 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNIZER_H_ | 163 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNIZER_H_ |
OLD | NEW |