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

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

Issue 7086005: Context menu for "Voice recognition options" (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: No changes (Just trying to get commit-bot to wake up) Created 9 years, 4 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <list> 8 #include <list>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 float noise_volume) = 0; 75 float noise_volume) = 0;
76 76
77 protected: 77 protected:
78 virtual ~Delegate() {} 78 virtual ~Delegate() {}
79 }; 79 };
80 80
81 SpeechRecognizer(Delegate* delegate, 81 SpeechRecognizer(Delegate* delegate,
82 int caller_id, 82 int caller_id,
83 const std::string& language, 83 const std::string& language,
84 const std::string& grammar, 84 const std::string& grammar,
85 bool censor_results,
85 const std::string& hardware_info, 86 const std::string& hardware_info,
86 const std::string& origin_url); 87 const std::string& origin_url);
87 virtual ~SpeechRecognizer(); 88 virtual ~SpeechRecognizer();
88 89
89 // Starts audio recording and does recognition after recording ends. The same 90 // Starts audio recording and does recognition after recording ends. The same
90 // SpeechRecognizer instance can be used multiple times for speech recognition 91 // SpeechRecognizer instance can be used multiple times for speech recognition
91 // though each recognition request can be made only after the previous one 92 // though each recognition request can be made only after the previous one
92 // completes (i.e. after receiving Delegate::DidCompleteRecognition). 93 // completes (i.e. after receiving Delegate::DidCompleteRecognition).
93 bool StartRecording(); 94 bool StartRecording();
94 95
(...skipping 29 matching lines...) Expand all
124 125
125 void HandleOnError(int error_code); // Handles OnError in the IO thread. 126 void HandleOnError(int error_code); // Handles OnError in the IO thread.
126 127
127 // Handles OnData in the IO thread. Takes ownership of |data|. 128 // Handles OnData in the IO thread. Takes ownership of |data|.
128 void HandleOnData(std::string* data); 129 void HandleOnData(std::string* data);
129 130
130 Delegate* delegate_; 131 Delegate* delegate_;
131 int caller_id_; 132 int caller_id_;
132 std::string language_; 133 std::string language_;
133 std::string grammar_; 134 std::string grammar_;
135 bool censor_results_;
134 std::string hardware_info_; 136 std::string hardware_info_;
135 std::string origin_url_; 137 std::string origin_url_;
136 138
137 scoped_ptr<SpeechRecognitionRequest> request_; 139 scoped_ptr<SpeechRecognitionRequest> request_;
138 scoped_refptr<media::AudioInputController> audio_controller_; 140 scoped_refptr<media::AudioInputController> audio_controller_;
139 AudioEncoder::Codec codec_; 141 AudioEncoder::Codec codec_;
140 scoped_ptr<AudioEncoder> encoder_; 142 scoped_ptr<AudioEncoder> encoder_;
141 Endpointer endpointer_; 143 Endpointer endpointer_;
142 int num_samples_recorded_; 144 int num_samples_recorded_;
143 float audio_level_; 145 float audio_level_;
144 146
145 DISALLOW_COPY_AND_ASSIGN(SpeechRecognizer); 147 DISALLOW_COPY_AND_ASSIGN(SpeechRecognizer);
146 }; 148 };
147 149
148 // This typedef is to workaround the issue with certain versions of 150 // This typedef is to workaround the issue with certain versions of
149 // Visual Studio where it gets confused between multiple Delegate 151 // Visual Studio where it gets confused between multiple Delegate
150 // classes and gives a C2500 error. (I saw this error on the try bots - 152 // classes and gives a C2500 error. (I saw this error on the try bots -
151 // the workaround was not needed for my machine). 153 // the workaround was not needed for my machine).
152 typedef SpeechRecognizer::Delegate SpeechRecognizerDelegate; 154 typedef SpeechRecognizer::Delegate SpeechRecognizerDelegate;
153 155
154 } // namespace speech_input 156 } // namespace speech_input
155 157
156 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNIZER_H_ 158 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNIZER_H_
OLDNEW
« no previous file with comments | « content/browser/speech/speech_recognition_request_unittest.cc ('k') | content/browser/speech/speech_recognizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698