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 // A Java counterpart will be generated for this enum.
11 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.content_public.common
12 // GENERATED_JAVA_PREFIX_TO_STRIP: SPEECH_RECOGNITION_ERROR_
13 enum SpeechRecognitionErrorCode
{
14 // There was no error.
15 SPEECH_RECOGNITION_ERROR_NONE
,
17 // The user or a script aborted speech input.
18 SPEECH_RECOGNITION_ERROR_ABORTED
,
20 // There was an error with recording audio.
21 SPEECH_RECOGNITION_ERROR_AUDIO
,
23 // There was a network error.
24 SPEECH_RECOGNITION_ERROR_NETWORK
,
26 // Not allowed for privacy or security reasons.
27 SPEECH_RECOGNITION_ERROR_NOT_ALLOWED
,
29 // No speech heard before timeout.
30 SPEECH_RECOGNITION_ERROR_NO_SPEECH
,
32 // Speech was heard, but could not be interpreted.
33 SPEECH_RECOGNITION_ERROR_NO_MATCH
,
35 // There was an error in the speech recognition grammar.
36 SPEECH_RECOGNITION_ERROR_BAD_GRAMMAR
,
37 SPEECH_RECOGNITION_ERROR_LAST
= SPEECH_RECOGNITION_ERROR_BAD_GRAMMAR
,
40 // Error details for the SPEECH_RECOGNITION_ERROR_AUDIO error.
41 enum SpeechAudioErrorDetails
{
42 SPEECH_AUDIO_ERROR_DETAILS_NONE
= 0,
43 SPEECH_AUDIO_ERROR_DETAILS_NO_MIC
,
44 SPEECH_AUDIO_ERROR_DETAILS_LAST
= SPEECH_AUDIO_ERROR_DETAILS_NO_MIC
47 struct CONTENT_EXPORT SpeechRecognitionError
{
48 SpeechRecognitionErrorCode code
;
49 SpeechAudioErrorDetails details
;
51 SpeechRecognitionError()
52 : code(SPEECH_RECOGNITION_ERROR_NONE
),
53 details(SPEECH_AUDIO_ERROR_DETAILS_NONE
) {
55 explicit SpeechRecognitionError(SpeechRecognitionErrorCode code_value
)
57 details(SPEECH_AUDIO_ERROR_DETAILS_NONE
) {
59 SpeechRecognitionError(SpeechRecognitionErrorCode code_value
,
60 SpeechAudioErrorDetails details_value
)
62 details(details_value
) {
66 } // namespace content
68 #endif // CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_ERROR_H_