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

Unified 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: mac bot fix. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/speech_input_messages.h ('k') | content/common/speech_input_result.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/speech_input_result.h
diff --git a/content/common/speech_input_result.h b/content/common/speech_input_result.h
index ed85959dca334ace84233c8ff57ee3a01a9dc4e5..f291cd1aeb18b72ab6845b23283565a93fb03f53 100644
--- a/content/common/speech_input_result.h
+++ b/content/common/speech_input_result.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -12,21 +12,39 @@
namespace speech_input {
-struct SpeechInputResultItem {
+struct SpeechInputHypothesis {
string16 utterance;
double confidence;
- SpeechInputResultItem()
- : confidence(0.0) {
- }
+ SpeechInputHypothesis() : confidence(0.0) {}
- SpeechInputResultItem(const string16 utterance_value, double confidence_value)
+ SpeechInputHypothesis(const string16 utterance_value, double confidence_value)
: utterance(utterance_value),
confidence(confidence_value) {
}
};
-typedef std::vector<SpeechInputResultItem> SpeechInputResultArray;
+typedef std::vector<SpeechInputHypothesis> SpeechInputHypothesisArray;
+
+// This enumeration follows the values described here:
+// http://www.w3.org/2005/Incubator/htmlspeech/2010/10/google-api-draft.html#speech-input-error
+enum SpeechInputError {
+ kErrorNone = 0, // There was no error.
+ kErrorAborted, // The user or a script aborted speech input.
+ kErrorAudio, // There was an error with recording audio.
+ kErrorNetwork, // There was a network error.
+ kErrorNoSpeech, // No speech heard before timeout.
+ kErrorNoMatch, // Speech was heard, but could not be interpreted.
+ kErrorBadGrammar, // There was an error in the speech recognition grammar.
+};
+
+struct SpeechInputResult {
+ SpeechInputError error;
+ SpeechInputHypothesisArray hypotheses;
+
+ SpeechInputResult();
+ ~SpeechInputResult();
+};
} // namespace speech_input
« no previous file with comments | « content/common/speech_input_messages.h ('k') | content/common/speech_input_result.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698