1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_ERROR_H_
6 #define CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_ERROR_H_
10 enum SpeechRecognitionErrorCode
{
11 // There was no error.
12 SPEECH_RECOGNITION_ERROR_NONE
= 0,
13 // The user or a script aborted speech input.
14 SPEECH_RECOGNITION_ERROR_ABORTED
,
15 // There was an error with recording audio.
16 SPEECH_RECOGNITION_ERROR_AUDIO
,
17 // There was a network error.
18 SPEECH_RECOGNITION_ERROR_NETWORK
,
19 // No speech heard before timeout.
20 SPEECH_RECOGNITION_ERROR_NO_SPEECH
,
21 // Speech was heard, but could not be interpreted.
22 SPEECH_RECOGNITION_ERROR_NO_MATCH
,
23 // There was an error in the speech recognition grammar.
24 SPEECH_RECOGNITION_ERROR_BAD_GRAMMAR
,
27 // Error details for the SPEECH_RECOGNITION_ERROR_AUDIO error.
28 enum SpeechAudioErrorDetails
{
29 SPEECH_AUDIO_ERROR_DETAILS_NONE
= 0,
30 SPEECH_AUDIO_ERROR_DETAILS_NO_MIC
,
31 SPEECH_AUDIO_ERROR_DETAILS_IN_USE
34 struct CONTENT_EXPORT SpeechRecognitionError
{
35 SpeechRecognitionErrorCode code
;
36 SpeechAudioErrorDetails details
;
38 SpeechRecognitionError()
39 : code(SPEECH_RECOGNITION_ERROR_NONE
),
40 details(SPEECH_AUDIO_ERROR_DETAILS_NONE
) {
42 explicit SpeechRecognitionError(SpeechRecognitionErrorCode code_value
)
44 details(SPEECH_AUDIO_ERROR_DETAILS_NONE
) {
46 SpeechRecognitionError(SpeechRecognitionErrorCode code_value
,
47 SpeechAudioErrorDetails details_value
)
49 details(details_value
) {
53 } // namespace content
55 #endif // CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_ERROR_H_