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

Unified Diff: content/public/common/speech_recognition_result.h

Issue 9568002: Renamed speech input implementation from to speech_recognition_*. The namespace has been renamed fr… (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebased from master. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/common/speech_input_result.cc ('k') | content/public/common/speech_recognition_result.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/common/speech_recognition_result.h
diff --git a/content/public/common/speech_recognition_result.h b/content/public/common/speech_recognition_result.h
new file mode 100644
index 0000000000000000000000000000000000000000..e5efe5ba9a6362305ec38727aa80a3e752b40d51
--- /dev/null
+++ b/content/public/common/speech_recognition_result.h
@@ -0,0 +1,61 @@
+// Copyright (c) 2012 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.
+
+#ifndef CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_RESULT_H_
+#define CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_RESULT_H_
+
+#include <vector>
+
+#include "base/basictypes.h"
+#include "base/string16.h"
+#include "content/common/content_export.h"
+
+namespace content {
+
+struct SpeechRecognitionHypothesis {
+ string16 utterance;
+ double confidence;
+
+ SpeechRecognitionHypothesis() : confidence(0.0) {}
+
+ SpeechRecognitionHypothesis(const string16 utterance_value,
+ double confidence_value)
+ : utterance(utterance_value),
+ confidence(confidence_value) {
+ }
+};
+
+typedef std::vector<SpeechRecognitionHypothesis>
+ SpeechRecognitionHypothesisArray;
+
+// This enumeration follows the values described here:
+// http://www.w3.org/2005/Incubator/htmlspeech/2010/10/google-api-draft.html#speech-input-error
+enum SpeechRecognitionErrorCode {
+ // There was no error.
+ SPEECH_RECOGNITION_ERROR_NONE = 0,
+ // The user or a script aborted speech input.
+ SPEECH_RECOGNITION_ERROR_ABORTED,
+ // There was an error with recording audio.
+ SPEECH_RECOGNITION_ERROR_AUDIO,
+ // There was a network error.
+ SPEECH_RECOGNITION_ERROR_NETWORK,
+ // No speech heard before timeout.
+ SPEECH_RECOGNITION_ERROR_NO_SPEECH,
+ // Speech was heard, but could not be interpreted.
+ SPEECH_RECOGNITION_ERROR_NO_MATCH,
+ // There was an error in the speech recognition grammar.
+ SPEECH_RECOGNITION_ERROR_BAD_GRAMMAR,
+};
+
+struct CONTENT_EXPORT SpeechRecognitionResult {
+ SpeechRecognitionErrorCode error;
+ SpeechRecognitionHypothesisArray hypotheses;
+
+ SpeechRecognitionResult();
+ ~SpeechRecognitionResult();
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_RESULT_H_
« no previous file with comments | « content/public/common/speech_input_result.cc ('k') | content/public/common/speech_recognition_result.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698