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_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_SPEECH_SPEECH_RECOGNIZER_IMPL_H_ |
6 #define CONTENT_BROWSER_SPEECH_SPEECH_RECOGNIZER_IMPL_H_ | 6 #define CONTENT_BROWSER_SPEECH_SPEECH_RECOGNIZER_IMPL_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "content/browser/speech/audio_encoder.h" | 13 #include "content/browser/speech/audio_encoder.h" |
14 #include "content/browser/speech/endpointer/endpointer.h" | 14 #include "content/browser/speech/endpointer/endpointer.h" |
15 #include "content/browser/speech/speech_recognition_request.h" | 15 #include "content/browser/speech/speech_recognition_request.h" |
16 #include "content/public/browser/speech_recognizer.h" | 16 #include "content/public/browser/speech_recognizer.h" |
17 #include "content/public/common/speech_input_result.h" | 17 #include "content/public/common/speech_recognition_traits.h" |
18 #include "media/audio/audio_input_controller.h" | 18 #include "media/audio/audio_input_controller.h" |
19 | 19 |
20 class AudioManager; | 20 class AudioManager; |
21 | 21 |
22 namespace speech_input { | 22 namespace speech { |
23 | 23 |
24 // Records audio, sends recorded audio to server and translates server response | 24 // Records audio, sends recorded audio to server and translates server response |
25 // to recognition result. | 25 // to recognition result. |
26 class CONTENT_EXPORT SpeechRecognizerImpl | 26 class CONTENT_EXPORT SpeechRecognizerImpl |
27 : NON_EXPORTED_BASE(public content::SpeechRecognizer), | 27 : NON_EXPORTED_BASE(public content::SpeechRecognizer), |
28 public media::AudioInputController::EventHandler, | 28 public media::AudioInputController::EventHandler, |
29 public SpeechRecognitionRequestDelegate { | 29 public SpeechRecognitionRequestDelegate { |
30 public: | 30 public: |
31 SpeechRecognizerImpl(content::SpeechRecognizerDelegate* delegate, | 31 SpeechRecognizerImpl(content::SpeechRecognizerDelegate* delegate, |
32 int caller_id, | 32 int caller_id, |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 AudioEncoder::Codec codec_; | 96 AudioEncoder::Codec codec_; |
97 scoped_ptr<AudioEncoder> encoder_; | 97 scoped_ptr<AudioEncoder> encoder_; |
98 Endpointer endpointer_; | 98 Endpointer endpointer_; |
99 int num_samples_recorded_; | 99 int num_samples_recorded_; |
100 float audio_level_; | 100 float audio_level_; |
101 AudioManager* audio_manager_; | 101 AudioManager* audio_manager_; |
102 | 102 |
103 DISALLOW_COPY_AND_ASSIGN(SpeechRecognizerImpl); | 103 DISALLOW_COPY_AND_ASSIGN(SpeechRecognizerImpl); |
104 }; | 104 }; |
105 | 105 |
106 } // namespace speech_input | 106 } // namespace speech |
107 | 107 |
108 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNIZER_IMPL_H_ | 108 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNIZER_IMPL_H_ |
OLD | NEW |