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_RESULT_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_RESULT_H_ |
6 #define CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_RESULT_H_ | 6 #define CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_RESULT_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 // There was a network error. | 41 // There was a network error. |
42 SPEECH_RECOGNITION_ERROR_NETWORK, | 42 SPEECH_RECOGNITION_ERROR_NETWORK, |
43 // No speech heard before timeout. | 43 // No speech heard before timeout. |
44 SPEECH_RECOGNITION_ERROR_NO_SPEECH, | 44 SPEECH_RECOGNITION_ERROR_NO_SPEECH, |
45 // Speech was heard, but could not be interpreted. | 45 // Speech was heard, but could not be interpreted. |
46 SPEECH_RECOGNITION_ERROR_NO_MATCH, | 46 SPEECH_RECOGNITION_ERROR_NO_MATCH, |
47 // There was an error in the speech recognition grammar. | 47 // There was an error in the speech recognition grammar. |
48 SPEECH_RECOGNITION_ERROR_BAD_GRAMMAR, | 48 SPEECH_RECOGNITION_ERROR_BAD_GRAMMAR, |
49 }; | 49 }; |
50 | 50 |
| 51 // Error details for the SPEECH_RECOGNITION_ERROR_AUDIO error. |
| 52 enum SpeechAudioErrorDetails { |
| 53 AUDIO_ERROR_UNKNOWN = 0, |
| 54 AUDIO_ERROR_NO_MIC, |
| 55 AUDIO_ERROR_MIC_IN_USE |
| 56 }; |
| 57 |
| 58 struct CONTENT_EXPORT SpeechRecognitionError { |
| 59 SpeechRecognitionErrorCode code; |
| 60 int details; |
| 61 |
| 62 SpeechRecognitionError(); |
| 63 SpeechRecognitionError(SpeechRecognitionErrorCode code_value); |
| 64 SpeechRecognitionError(SpeechRecognitionErrorCode code_val, int details_val); |
| 65 }; |
| 66 |
51 struct CONTENT_EXPORT SpeechRecognitionResult { | 67 struct CONTENT_EXPORT SpeechRecognitionResult { |
52 SpeechRecognitionErrorCode error; | 68 SpeechRecognitionErrorCode error; // TODO(primiano) This is transitional. |
53 SpeechRecognitionHypothesisArray hypotheses; | 69 SpeechRecognitionHypothesisArray hypotheses; |
54 | 70 |
55 SpeechRecognitionResult(); | 71 SpeechRecognitionResult(); |
56 ~SpeechRecognitionResult(); | 72 ~SpeechRecognitionResult(); |
57 }; | 73 }; |
58 | 74 |
59 } // namespace content | 75 } // namespace content |
60 | 76 |
61 #endif // CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_RESULT_H_ | 77 #endif // CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_RESULT_H_ |
OLD | NEW |