Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Side by Side Diff: content/browser/speech/speech_recognizer_impl.h

Issue 9805001: Move media/audio files into media namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix various compiler errors Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_recognition_result.h" 17 #include "content/public/common/speech_recognition_result.h"
18 #include "media/audio/audio_input_controller.h" 18 #include "media/audio/audio_input_controller.h"
19 19
20 class AudioManager;
21
22 namespace content { 20 namespace content {
23 class SpeechRecognitionEventListener; 21 class SpeechRecognitionEventListener;
24 } 22 }
25 23
24 namespace media {
25 class AudioManager;
26 }
27
26 namespace speech { 28 namespace speech {
27 29
28 // Records audio, sends recorded audio to server and translates server response 30 // Records audio, sends recorded audio to server and translates server response
29 // to recognition result. 31 // to recognition result.
30 class CONTENT_EXPORT SpeechRecognizerImpl 32 class CONTENT_EXPORT SpeechRecognizerImpl
31 : NON_EXPORTED_BASE(public content::SpeechRecognizer), 33 : NON_EXPORTED_BASE(public content::SpeechRecognizer),
32 public media::AudioInputController::EventHandler, 34 public media::AudioInputController::EventHandler,
33 public SpeechRecognitionRequestDelegate { 35 public SpeechRecognitionRequestDelegate {
34 public: 36 public:
35 static const int kAudioSampleRate; 37 static const int kAudioSampleRate;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 void SendRecordedAudioToServer(); 80 void SendRecordedAudioToServer();
79 81
80 void HandleOnError(int error_code); // Handles OnError in the IO thread. 82 void HandleOnError(int error_code); // Handles OnError in the IO thread.
81 83
82 // Handles OnData in the IO thread. Takes ownership of |raw_audio|. 84 // Handles OnData in the IO thread. Takes ownership of |raw_audio|.
83 void HandleOnData(AudioChunk* raw_audio); 85 void HandleOnData(AudioChunk* raw_audio);
84 86
85 // Helper method which closes the audio controller and blocks until done. 87 // Helper method which closes the audio controller and blocks until done.
86 void CloseAudioControllerSynchronously(); 88 void CloseAudioControllerSynchronously();
87 89
88 void SetAudioManagerForTesting(AudioManager* audio_manager); 90 void SetAudioManagerForTesting(media::AudioManager* audio_manager);
89 91
90 content::SpeechRecognitionEventListener* listener_; 92 content::SpeechRecognitionEventListener* listener_;
91 int caller_id_; 93 int caller_id_;
92 std::string language_; 94 std::string language_;
93 std::string grammar_; 95 std::string grammar_;
94 bool filter_profanities_; 96 bool filter_profanities_;
95 std::string hardware_info_; 97 std::string hardware_info_;
96 std::string origin_url_; 98 std::string origin_url_;
97 99
98 scoped_ptr<SpeechRecognitionRequest> request_; 100 scoped_ptr<SpeechRecognitionRequest> request_;
99 scoped_refptr<media::AudioInputController> audio_controller_; 101 scoped_refptr<media::AudioInputController> audio_controller_;
100 scoped_refptr<net::URLRequestContextGetter> context_getter_; 102 scoped_refptr<net::URLRequestContextGetter> context_getter_;
101 AudioEncoder::Codec codec_; 103 AudioEncoder::Codec codec_;
102 scoped_ptr<AudioEncoder> encoder_; 104 scoped_ptr<AudioEncoder> encoder_;
103 Endpointer endpointer_; 105 Endpointer endpointer_;
104 int num_samples_recorded_; 106 int num_samples_recorded_;
105 float audio_level_; 107 float audio_level_;
106 AudioManager* audio_manager_; 108 media::AudioManager* audio_manager_;
107 109
108 DISALLOW_COPY_AND_ASSIGN(SpeechRecognizerImpl); 110 DISALLOW_COPY_AND_ASSIGN(SpeechRecognizerImpl);
109 }; 111 };
110 112
111 } // namespace speech 113 } // namespace speech
112 114
113 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNIZER_IMPL_H_ 115 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNIZER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698