|
1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __SPEECHRECOGNTIONDATACOMMON_H__ |
|
17 #define __SPEECHRECOGNTIONDATACOMMON_H__ |
|
18 |
|
19 // INCLUDES |
|
20 #include <e32base.h> |
|
21 #include <speechrecognitionuids.hrh> |
|
22 |
|
23 // TYPEDEFS |
|
24 typedef TUint32 TModelBankID; |
|
25 typedef TUint32 TModelID; |
|
26 typedef TUint32 TPhonemeID; |
|
27 typedef TUint32 TLexiconID; |
|
28 typedef TUint32 TPronunciationID; |
|
29 typedef TUint32 TGrammarID; |
|
30 typedef TUint32 TRuleID; |
|
31 |
|
32 typedef TInt TSpeechRecognitionEvent; |
|
33 typedef TInt TSpeechRecognitionResult; |
|
34 |
|
35 static const TUid KUidMediaTypeASR = {KUidMediaTypeASRDefine}; |
|
36 |
|
37 // CONSTANTS |
|
38 const TInt KUidAsrEventTrainReadyVal = 0x101FBF9E; |
|
39 const TInt KUidAsrEventTrainVal = 0x101FBF9F; |
|
40 const TInt KUidAsrEventAddPronunciationVal = 0x101FBFA0; |
|
41 const TInt KUidAsrEventAddRuleVal = 0x101FBFA1; |
|
42 const TInt KUidAsrEventLoadModelsVal = 0x101FBFA2; |
|
43 const TInt KUidAsrEventLoadLexiconVal = 0x101FBFA3; |
|
44 const TInt KUidAsrEventLoadGrammarVal = 0x101FBFA4; |
|
45 const TInt KUidAsrEventRecognitionReadyVal = 0x101FBFA5; |
|
46 const TInt KUidAsrEventRecognitionVal = 0x101FBFA6; |
|
47 const TInt KUidAsrEventUnloadRuleVal = 0x101FBFA7; |
|
48 const TInt KUidAsrEventRecordStartedVal = 0x101FBFA8; |
|
49 const TInt KUidAsrEventRecordVal = 0x101FBFA9; |
|
50 const TInt KUidAsrEventEouDetectedVal = 0x101FBFAA; |
|
51 const TInt KUidAsrEventPlayStartedVal = 0x101FBFAB; |
|
52 const TInt KUidAsrEventPlayVal = 0x101FBFAC; |
|
53 const TInt KUidAsrEventCreateGrammarVal = 0x101FBFAD; |
|
54 const TInt KUidAsrEventCreateLexiconVal = 0x101FBFAE; |
|
55 const TInt KUidAsrEventCreateModelBankVal = 0x101FBFAF; |
|
56 const TInt KUidAsrEventRemoveGrammarVal = 0x101FBFB0; |
|
57 const TInt KUidAsrEventRemoveLexiconVal = 0x101FBFB1; |
|
58 const TInt KUidAsrEventRemoveModelBankVal = 0x101FBFB2; |
|
59 const TInt KUidAsrEventRemoveRuleVal = 0x101FBFB3; |
|
60 const TInt KUidAsrEventRemovePronunciationVal = 0x101FBFB4; |
|
61 const TInt KUidAsrEventRemoveModelVal = 0x101FBFB5; |
|
62 const TInt KUidAsrEventGetAvailableStorageVal = 0x101FBFB6; |
|
63 const TInt KUidAsrEventGetRuleValidityVal = 0x101FBFB7; |
|
64 const TInt KUidAsrEventGetUtteranceDurationVal = 0x101FBFB8; |
|
65 const TInt KUidAsrEventGetModelCountVal = 0x101FBFB9; |
|
66 const TInt KUidAsrEventGetAllRuleIDsVal = 0x101FBFBA; |
|
67 const TInt KUidAsrEventGetAllPronunciationIDsVal = 0x101FBFBB; |
|
68 const TInt KUidAsrEventGetAllModelIDsVal = 0x101FBFBC; |
|
69 const TInt KUidAsrEventGetAllClientGrammarIDsVal = 0x101FBFBD; |
|
70 const TInt KUidAsrEventGetAllClientLexiconIDsVal = 0x101FBFBE; |
|
71 const TInt KUidAsrEventGetAllClientModelBankIDsVal = 0x101FBFBF; |
|
72 const TInt KUidAsrEventGetAllGrammarIDsVal = 0x101FBFC0; |
|
73 const TInt KUidAsrEventGetAllLexiconIDsVal = 0x101FBFC1; |
|
74 const TInt KUidAsrEventGetAllModelBankIDsVal = 0x101FBFC2; |
|
75 |
|
76 const TUid KUidAsrEventTrainReady = {KUidAsrEventTrainReadyVal}; |
|
77 const TUid KUidAsrEventTrain = {KUidAsrEventTrainVal}; |
|
78 const TUid KUidAsrEventAddPronunciation = {KUidAsrEventAddPronunciationVal}; |
|
79 const TUid KUidAsrEventAddRule = {KUidAsrEventAddRuleVal}; |
|
80 const TUid KUidAsrEventLoadModels = {KUidAsrEventLoadModelsVal}; |
|
81 const TUid KUidAsrEventLoadLexicon = {KUidAsrEventLoadLexiconVal}; |
|
82 const TUid KUidAsrEventLoadGrammar = {KUidAsrEventLoadGrammarVal}; |
|
83 const TUid KUidAsrEventRecognitionReady = {KUidAsrEventRecognitionReadyVal}; |
|
84 const TUid KUidAsrEventRecognition = {KUidAsrEventRecognitionVal}; |
|
85 const TUid KUidAsrEventUnloadRule = {KUidAsrEventUnloadRuleVal}; |
|
86 const TUid KUidAsrEventRecordStarted = {KUidAsrEventRecordStartedVal}; |
|
87 const TUid KUidAsrEventRecord = {KUidAsrEventRecordVal}; |
|
88 const TUid KUidAsrEventEouDetected = {KUidAsrEventEouDetectedVal}; |
|
89 const TUid KUidAsrEventPlayStarted = {KUidAsrEventPlayStartedVal}; |
|
90 const TUid KUidAsrEventPlay = {KUidAsrEventPlayVal}; |
|
91 const TUid KUidAsrEventCreateGrammar = {KUidAsrEventCreateGrammarVal}; |
|
92 const TUid KUidAsrEventCreateLexicon = {KUidAsrEventCreateLexiconVal}; |
|
93 const TUid KUidAsrEventCreateModelBank = {KUidAsrEventCreateModelBankVal}; |
|
94 const TUid KUidAsrEventRemoveGrammar = {KUidAsrEventRemoveGrammarVal}; |
|
95 const TUid KUidAsrEventRemoveLexicon = {KUidAsrEventRemoveLexiconVal}; |
|
96 const TUid KUidAsrEventRemoveModelBank = {KUidAsrEventRemoveModelBankVal}; |
|
97 const TUid KUidAsrEventRemoveRule = {KUidAsrEventRemoveRuleVal}; |
|
98 const TUid KUidAsrEventRemovePronunciation = {KUidAsrEventRemovePronunciationVal}; |
|
99 const TUid KUidAsrEventRemoveModel = {KUidAsrEventRemoveModelVal}; |
|
100 const TUid KUidAsrEventGetAvailableStorage = {KUidAsrEventGetAvailableStorageVal}; |
|
101 const TUid KUidAsrEventGetRuleValidity = {KUidAsrEventGetRuleValidityVal}; |
|
102 const TUid KUidAsrEventGetUtteranceDuration = {KUidAsrEventGetUtteranceDurationVal}; |
|
103 const TUid KUidAsrEventGetModelCount = {KUidAsrEventGetModelCountVal}; |
|
104 const TUid KUidAsrEventGetAllRuleIDs = {KUidAsrEventGetAllRuleIDsVal}; |
|
105 const TUid KUidAsrEventGetAllPronunciationIDs = {KUidAsrEventGetAllPronunciationIDsVal}; |
|
106 const TUid KUidAsrEventGetAllModelIDs = {KUidAsrEventGetAllModelIDsVal}; |
|
107 const TUid KUidAsrEventGetAllClientGrammarIDs = {KUidAsrEventGetAllClientGrammarIDsVal}; |
|
108 const TUid KUidAsrEventGetAllClientLexiconIDs = {KUidAsrEventGetAllClientLexiconIDsVal}; |
|
109 const TUid KUidAsrEventGetAllClientModelBankIDs = {KUidAsrEventGetAllClientModelBankIDsVal}; |
|
110 const TUid KUidAsrEventGetAllGrammarIDs = {KUidAsrEventGetAllGrammarIDsVal}; |
|
111 const TUid KUidAsrEventGetAllLexiconIDs = {KUidAsrEventGetAllLexiconIDsVal}; |
|
112 const TUid KUidAsrEventGetAllModelBankIDs = {KUidAsrEventGetAllModelBankIDsVal}; |
|
113 |
|
114 // Speech Recognition Errors |
|
115 const TInt KErrAsrNoSpeech = -12050; |
|
116 const TInt KErrAsrSpeechTooEarly = -12051; |
|
117 const TInt KErrAsrSpeechTooLong = -12052; |
|
118 const TInt KErrAsrSpeechTooShort = -12053; |
|
119 const TInt KErrAsrNoMatch = -12054; |
|
120 const TInt KErrAsrDataRightViolation = -12055; |
|
121 const TInt KErrAsrNotRegisted = -12056; |
|
122 const TInt KErrAsrInvalidState = -12057; |
|
123 const TInt KErrAsrInitializationFailure = -12058; |
|
124 |
|
125 // Pre-defined Engine Parameter Identifiers starts from index 0x01 |
|
126 // User-define Engine Parameter Identifiers starts from index 0x10000 and end at index KMaxTInt. |
|
127 const TInt KRecognizerMode = 0x01; |
|
128 const TInt KGrammarSupport = 0x02; |
|
129 const TInt KLoadMultipleGrammars = 0x03; |
|
130 const TInt KLoadMultipleLexicons = 0x04; |
|
131 const TInt KLoadMultipleModelBanks = 0x05; |
|
132 const TInt KModelStorageCapacity = 0x06; |
|
133 const TInt KMaxLoadableModels = 0x07; |
|
134 const TInt KMaxFrontEndBackEndDelay = 0x08; |
|
135 const TInt KSamplingRate = 0x09; |
|
136 const TInt KBitsPerSample = 0x0A; |
|
137 |
|
138 /** |
|
139 @publishedAll |
|
140 @released |
|
141 |
|
142 Speech recognition mode. |
|
143 */ |
|
144 enum TRecognitionMode |
|
145 { |
|
146 /** Speaker dependant recognition mode. |
|
147 */ |
|
148 ESdMode, |
|
149 /** Speaker independant recognition mode. |
|
150 */ |
|
151 ESiMode, |
|
152 /** Combined speaker dependant and independant recognition mode. |
|
153 */ |
|
154 ESdSiMode |
|
155 }; |
|
156 |
|
157 /** |
|
158 @publishedAll |
|
159 @released |
|
160 |
|
161 Grammar Support. |
|
162 */ |
|
163 enum TGrammarSupport |
|
164 { |
|
165 /** Simple grammar support only. |
|
166 */ |
|
167 ESimpleGrammar, |
|
168 /** Full W3C grammar support. |
|
169 */ |
|
170 EW3CGrammar |
|
171 }; |
|
172 |
|
173 #endif // __SPEECHRECOGNTIONDATACOMMON_H__ |