diff options
Diffstat (limited to 'content/public/common')
| -rw-r--r-- | content/public/common/speech_input_result.cc | 16 | ||||
| -rw-r--r-- | content/public/common/speech_input_result.h | 59 | ||||
| -rw-r--r-- | content/public/common/speech_recognition_result.cc | 16 | ||||
| -rw-r--r-- | content/public/common/speech_recognition_result.h | 61 |
4 files changed, 77 insertions, 75 deletions
diff --git a/content/public/common/speech_input_result.cc b/content/public/common/speech_input_result.cc deleted file mode 100644 index 3c9e1f3..0000000 --- a/content/public/common/speech_input_result.cc +++ /dev/null @@ -1,16 +0,0 @@ -// 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. - -#include "content/public/common/speech_input_result.h" - -namespace content { - -SpeechInputResult::SpeechInputResult() - : error(SPEECH_INPUT_ERROR_NONE) { -} - -SpeechInputResult::~SpeechInputResult() { -} - -} // namespace content diff --git a/content/public/common/speech_input_result.h b/content/public/common/speech_input_result.h deleted file mode 100644 index 1e494c7..0000000 --- a/content/public/common/speech_input_result.h +++ /dev/null @@ -1,59 +0,0 @@ -// 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. - -#ifndef CONTENT_PUBLIC_COMMON_SPEECH_INPUT_RESULT_H_ -#define CONTENT_PUBLIC_COMMON_SPEECH_INPUT_RESULT_H_ - -#include <vector> - -#include "base/basictypes.h" -#include "base/string16.h" -#include "content/common/content_export.h" - -namespace content { - -struct SpeechInputHypothesis { - string16 utterance; - double confidence; - - SpeechInputHypothesis() : confidence(0.0) {} - - SpeechInputHypothesis(const string16 utterance_value, double confidence_value) - : utterance(utterance_value), - confidence(confidence_value) { - } -}; - -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 { - // There was no error. - SPEECH_INPUT_ERROR_NONE = 0, - // The user or a script aborted speech input. - SPEECH_INPUT_ERROR_ABORTED, - // There was an error with recording audio. - SPEECH_INPUT_ERROR_AUDIO, - // There was a network error. - SPEECH_INPUT_ERROR_NETWORK, - // No speech heard before timeout. - SPEECH_INPUT_ERROR_NO_SPEECH, - // Speech was heard, but could not be interpreted. - SPEECH_INPUT_ERROR_NO_MATCH, - // There was an error in the speech recognition grammar. - SPEECH_INPUT_ERROR_BAD_GRAMMAR, -}; - -struct CONTENT_EXPORT SpeechInputResult { - SpeechInputError error; - SpeechInputHypothesisArray hypotheses; - - SpeechInputResult(); - ~SpeechInputResult(); -}; - -} // namespace content - -#endif // CONTENT_PUBLIC_COMMON_SPEECH_INPUT_RESULT_H_ diff --git a/content/public/common/speech_recognition_result.cc b/content/public/common/speech_recognition_result.cc new file mode 100644 index 0000000..198b88e --- /dev/null +++ b/content/public/common/speech_recognition_result.cc @@ -0,0 +1,16 @@ +// 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. + +#include "content/public/common/speech_recognition_result.h" + +namespace content { + +SpeechRecognitionResult::SpeechRecognitionResult() + : error(SPEECH_RECOGNITION_ERROR_NONE) { +} + +SpeechRecognitionResult::~SpeechRecognitionResult() { +} + +} diff --git a/content/public/common/speech_recognition_result.h b/content/public/common/speech_recognition_result.h new file mode 100644 index 0000000..e5efe5b --- /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_ |
