OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_ERROR_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_ERROR_H_ |
6 #define CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_ERROR_H_ | 6 #define CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_ERROR_H_ |
7 | 7 |
8 namespace content { | 8 namespace content { |
9 | 9 |
10 enum SpeechRecognitionErrorCode { | 10 enum SpeechRecognitionErrorCode { |
(...skipping 11 matching lines...) Expand all Loading... |
22 SPEECH_RECOGNITION_ERROR_NO_SPEECH, | 22 SPEECH_RECOGNITION_ERROR_NO_SPEECH, |
23 // Speech was heard, but could not be interpreted. | 23 // Speech was heard, but could not be interpreted. |
24 SPEECH_RECOGNITION_ERROR_NO_MATCH, | 24 SPEECH_RECOGNITION_ERROR_NO_MATCH, |
25 // There was an error in the speech recognition grammar. | 25 // There was an error in the speech recognition grammar. |
26 SPEECH_RECOGNITION_ERROR_BAD_GRAMMAR, | 26 SPEECH_RECOGNITION_ERROR_BAD_GRAMMAR, |
27 }; | 27 }; |
28 | 28 |
29 // Error details for the SPEECH_RECOGNITION_ERROR_AUDIO error. | 29 // Error details for the SPEECH_RECOGNITION_ERROR_AUDIO error. |
30 enum SpeechAudioErrorDetails { | 30 enum SpeechAudioErrorDetails { |
31 SPEECH_AUDIO_ERROR_DETAILS_NONE = 0, | 31 SPEECH_AUDIO_ERROR_DETAILS_NONE = 0, |
32 SPEECH_AUDIO_ERROR_DETAILS_NO_MIC, | 32 SPEECH_AUDIO_ERROR_DETAILS_NO_MIC |
33 SPEECH_AUDIO_ERROR_DETAILS_IN_USE | |
34 }; | 33 }; |
35 | 34 |
36 struct CONTENT_EXPORT SpeechRecognitionError { | 35 struct CONTENT_EXPORT SpeechRecognitionError { |
37 SpeechRecognitionErrorCode code; | 36 SpeechRecognitionErrorCode code; |
38 SpeechAudioErrorDetails details; | 37 SpeechAudioErrorDetails details; |
39 | 38 |
40 SpeechRecognitionError() | 39 SpeechRecognitionError() |
41 : code(SPEECH_RECOGNITION_ERROR_NONE), | 40 : code(SPEECH_RECOGNITION_ERROR_NONE), |
42 details(SPEECH_AUDIO_ERROR_DETAILS_NONE) { | 41 details(SPEECH_AUDIO_ERROR_DETAILS_NONE) { |
43 } | 42 } |
44 explicit SpeechRecognitionError(SpeechRecognitionErrorCode code_value) | 43 explicit SpeechRecognitionError(SpeechRecognitionErrorCode code_value) |
45 : code(code_value), | 44 : code(code_value), |
46 details(SPEECH_AUDIO_ERROR_DETAILS_NONE) { | 45 details(SPEECH_AUDIO_ERROR_DETAILS_NONE) { |
47 } | 46 } |
48 SpeechRecognitionError(SpeechRecognitionErrorCode code_value, | 47 SpeechRecognitionError(SpeechRecognitionErrorCode code_value, |
49 SpeechAudioErrorDetails details_value) | 48 SpeechAudioErrorDetails details_value) |
50 : code(code_value), | 49 : code(code_value), |
51 details(details_value) { | 50 details(details_value) { |
52 } | 51 } |
53 }; | 52 }; |
54 | 53 |
55 } // namespace content | 54 } // namespace content |
56 | 55 |
57 #endif // CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_ERROR_H_ | 56 #endif // CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_ERROR_H_ |
OLD | NEW |