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

Side by Side Diff: content/common/speech_input_result.h

Issue 8137005: Applying changes to the existing speech input code to support the extension API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more review fixes. Created 9 years, 2 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_COMMON_SPEECH_INPUT_RESULT_H_ 5 #ifndef CONTENT_COMMON_SPEECH_INPUT_RESULT_H_
6 #define CONTENT_COMMON_SPEECH_INPUT_RESULT_H_ 6 #define CONTENT_COMMON_SPEECH_INPUT_RESULT_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/string16.h" 11 #include "base/string16.h"
12 12
13 namespace speech_input { 13 namespace speech_input {
14 14
15 struct SpeechInputResultItem { 15 struct SpeechInputHypothesis {
16 string16 utterance; 16 string16 utterance;
17 double confidence; 17 double confidence;
18 18
19 SpeechInputResultItem() 19 SpeechInputHypothesis() : confidence(0.0) {}
20 : confidence(0.0) {
21 }
22 20
23 SpeechInputResultItem(const string16 utterance_value, double confidence_value) 21 SpeechInputHypothesis(const string16 utterance_value, double confidence_value)
24 : utterance(utterance_value), 22 : utterance(utterance_value),
25 confidence(confidence_value) { 23 confidence(confidence_value) {
26 } 24 }
27 }; 25 };
28 26
29 typedef std::vector<SpeechInputResultItem> SpeechInputResultArray; 27 typedef std::vector<SpeechInputHypothesis> SpeechInputHypothesisArray;
28
29 // This enumeration follows the values described here:
30 // http://www.w3.org/2005/Incubator/htmlspeech/2010/10/ (continues below)
Satish 2011/10/06 20:30:12 I think it is fine to have URLs > 80 chars, please
Leandro Graciá Gil 2011/10/06 22:00:28 Done.
31 // google-api-draft.html#speech-input-error
32 enum SpeechInputError {
33 kErrorNone = 0, // There was no error.
34 kErrorAborted, // The user or a script aborted speech input.
35 kErrorAudio, // There was an error with recording audio.
36 kErrorNetwork, // There was a network error.
37 kErrorNoSpeech, // No speech heard before timeout.
38 kErrorNoMatch, // Speech was heard, but could not be interpreted.
39 kErrorBadGrammar, // There was an error in the speech recognition grammar.
40 };
41
42 struct SpeechInputResult {
43 SpeechInputError error;
44 SpeechInputHypothesisArray hypotheses;
45
46 SpeechInputResult() : error(kErrorNone) {}
Satish 2011/10/06 20:30:12 mac bot complains about this, needs to go into a .
Leandro Graciá Gil 2011/10/06 22:00:28 Done.
47 };
30 48
31 } // namespace speech_input 49 } // namespace speech_input
32 50
33 #endif // CONTENT_COMMON_SPEECH_INPUT_RESULT_H_ 51 #endif // CONTENT_COMMON_SPEECH_INPUT_RESULT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698