|
1 /* |
|
2 * Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: This file contains common data shared between SISpeechRecognitionDataClient |
|
15 * %version: 10 % |
|
16 * and SISpeechRecognitionDataDevASR. |
|
17 * |
|
18 * Copyright © 2002-2006 Nokia Corporation. |
|
19 */ |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 #ifndef NSSSISPEECHRECOGNITIONDATACOMMON_H |
|
26 #define NSSSISPEECHRECOGNITIONDATACOMMON_H |
|
27 |
|
28 // INCLUDES |
|
29 #include <e32base.h> |
|
30 |
|
31 // For externalize/internalize |
|
32 #include <s32strm.h> |
|
33 // For |
|
34 #include <bamdesca.h> |
|
35 |
|
36 // TYPEDEFS |
|
37 typedef TUint16 TSIModelBankID; |
|
38 typedef TUint16 TSIModelID; |
|
39 |
|
40 typedef TUint16 TSILexiconID; |
|
41 typedef TUint32 TSIPronunciationID; |
|
42 |
|
43 typedef TUint16 TSIGrammarID; |
|
44 typedef TUint32 TSIRuleID; |
|
45 typedef TUint8 TSIRuleVariantID; |
|
46 |
|
47 typedef RArray<TSIPronunciationID> TSIPronunciationIDSequence; |
|
48 |
|
49 // Language array which is used as an element of another RArray |
|
50 typedef RArray<TLanguage> RLanguageArray; |
|
51 |
|
52 // CONSTANTS |
|
53 const TSIPronunciationID KUndefinedPronounciationID = 0x0; |
|
54 |
|
55 const TSIModelBankID KInvalidModelBankID = 0x7fff; |
|
56 const TSIModelID KInvalidModelID = 0x7fff; |
|
57 const TSILexiconID KInvalidLexiconID = 0x7fff; |
|
58 const TSIPronunciationID KInvalidPronunciationID=0x7fffffff; |
|
59 const TSIGrammarID KInvalidGrammarID = 0x7fff; |
|
60 const TSIRuleID KInvalidRuleID = 0x7fffffff; |
|
61 const TSIRuleVariantID KInvalidRuleVariantID = 0x7f; |
|
62 |
|
63 // ASCII phonemes can't be longer than this. |
|
64 const TInt KMaxPhonemeLength = 7; |
|
65 |
|
66 const TUint8 KPhonemeSeparator = '-'; |
|
67 |
|
68 |
|
69 |
|
70 // CONSTANTS |
|
71 const TInt KUidAsrEventTrainReadyVal = 0x101FBF9E; |
|
72 const TInt KUidAsrEventTrainVal = 0x101FBF9F; |
|
73 const TInt KUidAsrEventAddPronunciationVal = 0x101FBFA0; |
|
74 const TInt KUidAsrEventAddRuleVal = 0x101FBFA1; |
|
75 const TInt KUidAsrEventLoadModelsVal = 0x101FBFA2; |
|
76 const TInt KUidAsrEventLoadLexiconVal = 0x101FBFA3; |
|
77 const TInt KUidAsrEventLoadGrammarVal = 0x101FBFA4; |
|
78 const TInt KUidAsrEventRecognitionReadyVal = 0x101FBFA5; |
|
79 const TInt KUidAsrEventRecognitionVal = 0x101FBFA6; |
|
80 const TInt KUidAsrEventUnloadRuleVal = 0x101FBFA7; |
|
81 const TInt KUidAsrEventRecordStartedVal = 0x101FBFA8; |
|
82 const TInt KUidAsrEventRecordVal = 0x101FBFA9; |
|
83 const TInt KUidAsrEventEouDetectedVal = 0x101FBFAA; |
|
84 const TInt KUidAsrEventPlayStartedVal = 0x101FBFAB; |
|
85 const TInt KUidAsrEventPlayVal = 0x101FBFAC; |
|
86 const TInt KUidAsrEventCreateGrammarVal = 0x101FBFAD; |
|
87 const TInt KUidAsrEventCreateLexiconVal = 0x101FBFAE; |
|
88 const TInt KUidAsrEventCreateModelBankVal = 0x101FBFAF; |
|
89 const TInt KUidAsrEventRemoveGrammarVal = 0x101FBFB0; |
|
90 const TInt KUidAsrEventRemoveLexiconVal = 0x101FBFB1; |
|
91 const TInt KUidAsrEventRemoveModelBankVal = 0x101FBFB2; |
|
92 const TInt KUidAsrEventRemoveRuleVal = 0x101FBFB3; |
|
93 const TInt KUidAsrEventRemovePronunciationVal = 0x101FBFB4; |
|
94 const TInt KUidAsrEventRemoveModelVal = 0x101FBFB5; |
|
95 const TInt KUidAsrEventGetAvailableStorageVal = 0x101FBFB6; |
|
96 const TInt KUidAsrEventGetRuleValidityVal = 0x101FBFB7; |
|
97 const TInt KUidAsrEventGetUtteranceDurationVal = 0x101FBFB8; |
|
98 const TInt KUidAsrEventGetModelCountVal = 0x101FBFB9; |
|
99 const TInt KUidAsrEventGetAllRuleIDsVal = 0x101FBFBA; |
|
100 const TInt KUidAsrEventGetAllPronunciationIDsVal = 0x101FBFBB; |
|
101 const TInt KUidAsrEventGetAllModelIDsVal = 0x101FBFBC; |
|
102 const TInt KUidAsrEventGetAllClientGrammarIDsVal = 0x101FBFBD; |
|
103 const TInt KUidAsrEventGetAllClientLexiconIDsVal = 0x101FBFBE; |
|
104 const TInt KUidAsrEventGetAllClientModelBankIDsVal = 0x101FBFBF; |
|
105 const TInt KUidAsrEventGetAllGrammarIDsVal = 0x101FBFC0; |
|
106 const TInt KUidAsrEventGetAllLexiconIDsVal = 0x101FBFC1; |
|
107 const TInt KUidAsrEventGetAllModelBankIDsVal = 0x101FBFC2; |
|
108 |
|
109 // SI event values |
|
110 // !!!! There are not unique! Just successors of SD numbers. |
|
111 const TInt KUidAsrEventAdaptVal = 0x101FBFC3; |
|
112 const TInt KUidAsrEventAddVoiceTagVal = 0x101FBFC4; |
|
113 const TInt KUidAsrEventAddVoiceTagsVal = 0x101FBFC5; |
|
114 const TInt KUidAsrEventSIRecognitionVal = 0x101FBFC6; |
|
115 const TInt KUidAsrEventAddRuleVariantVal= 0x101FBFC7; |
|
116 const TInt KUidAsrEventCreateRuleVal = 0x101FBFC8; |
|
117 const TInt KUidAsrEventEndRecordVal = 0x101FBFC9; |
|
118 const TInt KUidAsrEventUnloadGrammarVal = 0x101FBFCA; |
|
119 |
|
120 |
|
121 const TInt KUidAsrEventUpdateGrammarAndLexiconVal = 0x101FBFCB; |
|
122 const TInt KUidAsrEventActivateGrammarVal = 0x101FBFCC; |
|
123 const TInt KUidAsrEventDeactivateGrammarVal = 0x101FBFCD; |
|
124 const TInt KUidAsrEventRemoveRulesVal = 0x101FBFCE; |
|
125 |
|
126 const TInt KUidAsrEventGetPronunciationCountVal = 0x101FBFCF; |
|
127 const TInt KUidAsrEventGetRuleCountVal = 0x101FBFD0; |
|
128 |
|
129 const TInt KUidAsrEventPreStartSamplingVal = 0x101FBFD1; |
|
130 |
|
131 const TUid KUidAsrEventTrainReady = {KUidAsrEventTrainReadyVal}; |
|
132 const TUid KUidAsrEventTrain = {KUidAsrEventTrainVal}; |
|
133 const TUid KUidAsrEventAddPronunciation = {KUidAsrEventAddPronunciationVal}; |
|
134 const TUid KUidAsrEventAddRule = {KUidAsrEventAddRuleVal}; |
|
135 const TUid KUidAsrEventLoadModels = {KUidAsrEventLoadModelsVal}; |
|
136 const TUid KUidAsrEventLoadLexicon = {KUidAsrEventLoadLexiconVal}; |
|
137 const TUid KUidAsrEventLoadGrammar = {KUidAsrEventLoadGrammarVal}; |
|
138 const TUid KUidAsrEventRecognitionReady = {KUidAsrEventRecognitionReadyVal}; |
|
139 const TUid KUidAsrEventRecognition = {KUidAsrEventRecognitionVal}; |
|
140 const TUid KUidAsrEventUnloadRule = {KUidAsrEventUnloadRuleVal}; |
|
141 const TUid KUidAsrEventRecordStarted = {KUidAsrEventRecordStartedVal}; |
|
142 const TUid KUidAsrEventRecord = {KUidAsrEventRecordVal}; |
|
143 const TUid KUidAsrEventEouDetected = {KUidAsrEventEouDetectedVal}; |
|
144 const TUid KUidAsrEventPlayStarted = {KUidAsrEventPlayStartedVal}; |
|
145 const TUid KUidAsrEventPlay = {KUidAsrEventPlayVal}; |
|
146 const TUid KUidAsrEventCreateGrammar = {KUidAsrEventCreateGrammarVal}; |
|
147 const TUid KUidAsrEventCreateLexicon = {KUidAsrEventCreateLexiconVal}; |
|
148 const TUid KUidAsrEventCreateModelBank = {KUidAsrEventCreateModelBankVal}; |
|
149 const TUid KUidAsrEventRemoveGrammar = {KUidAsrEventRemoveGrammarVal}; |
|
150 const TUid KUidAsrEventRemoveLexicon = {KUidAsrEventRemoveLexiconVal}; |
|
151 const TUid KUidAsrEventRemoveModelBank = {KUidAsrEventRemoveModelBankVal}; |
|
152 const TUid KUidAsrEventRemoveRule = {KUidAsrEventRemoveRuleVal}; |
|
153 const TUid KUidAsrEventRemovePronunciation = {KUidAsrEventRemovePronunciationVal}; |
|
154 const TUid KUidAsrEventRemoveModel = {KUidAsrEventRemoveModelVal}; |
|
155 const TUid KUidAsrEventGetAvailableStorage = {KUidAsrEventGetAvailableStorageVal}; |
|
156 const TUid KUidAsrEventGetRuleValidity = {KUidAsrEventGetRuleValidityVal}; |
|
157 const TUid KUidAsrEventGetUtteranceDuration = {KUidAsrEventGetUtteranceDurationVal}; |
|
158 |
|
159 const TUid KUidAsrEventGetModelCount = {KUidAsrEventGetModelCountVal}; |
|
160 const TUid KUidAsrEventGetPronunciationCount = {KUidAsrEventGetPronunciationCountVal}; |
|
161 const TUid KUidAsrEventGetRuleCount = {KUidAsrEventGetRuleCountVal}; |
|
162 |
|
163 const TUid KUidAsrEventGetAllRuleIDs = {KUidAsrEventGetAllRuleIDsVal}; |
|
164 const TUid KUidAsrEventGetAllPronunciationIDs = {KUidAsrEventGetAllPronunciationIDsVal}; |
|
165 const TUid KUidAsrEventGetAllModelIDs = {KUidAsrEventGetAllModelIDsVal}; |
|
166 const TUid KUidAsrEventGetAllClientGrammarIDs = {KUidAsrEventGetAllClientGrammarIDsVal}; |
|
167 const TUid KUidAsrEventGetAllClientLexiconIDs = {KUidAsrEventGetAllClientLexiconIDsVal}; |
|
168 const TUid KUidAsrEventGetAllClientModelBankIDs = {KUidAsrEventGetAllClientModelBankIDsVal}; |
|
169 const TUid KUidAsrEventGetAllGrammarIDs = {KUidAsrEventGetAllGrammarIDsVal}; |
|
170 const TUid KUidAsrEventGetAllLexiconIDs = {KUidAsrEventGetAllLexiconIDsVal}; |
|
171 const TUid KUidAsrEventGetAllModelBankIDs = {KUidAsrEventGetAllModelBankIDsVal}; |
|
172 |
|
173 // SI event UIDs |
|
174 const TUid KUidAsrEventAdapt = {KUidAsrEventAdaptVal}; |
|
175 const TUid KUidAsrEventAddVoiceTag = {KUidAsrEventAddVoiceTagVal}; |
|
176 const TUid KUidAsrEventAddVoiceTags = {KUidAsrEventAddVoiceTagsVal}; |
|
177 const TUid KUidAsrEventSIRecognition = {KUidAsrEventSIRecognitionVal}; |
|
178 const TUid KUidAsrEventAddRuleVariant= {KUidAsrEventAddRuleVariantVal}; |
|
179 const TUid KUidAsrEventCreateRule = {KUidAsrEventCreateRuleVal}; |
|
180 const TUid KUidAsrEventEndRecord = {KUidAsrEventEndRecordVal}; |
|
181 const TUid KUidAsrEventUnloadGrammar = {KUidAsrEventUnloadGrammarVal}; |
|
182 const TUid KUidAsrEventUpdateGrammarAndLexicon = {KUidAsrEventUpdateGrammarAndLexiconVal}; |
|
183 |
|
184 const TUid KUidAsrEventActivateGrammar = {KUidAsrEventActivateGrammarVal}; |
|
185 const TUid KUidAsrEventDeactivateGrammar = {KUidAsrEventDeactivateGrammarVal}; |
|
186 const TUid KUidAsrEventRemoveRules = {KUidAsrEventRemoveRulesVal}; |
|
187 |
|
188 const TInt KUidMediaTypeSIVal = 0x101FF932; |
|
189 const TUid KUidMediaTypeSI = {KUidMediaTypeSIVal}; |
|
190 |
|
191 const TUid KUidAsrEventPreStartSampling = {KUidAsrEventPreStartSamplingVal}; |
|
192 |
|
193 // Speech Recognition Errors |
|
194 const TInt KErrAsrNoSpeech = -12050; |
|
195 const TInt KErrAsrSpeechTooEarly = -12051; |
|
196 const TInt KErrAsrSpeechTooLong = -12052; |
|
197 const TInt KErrAsrSpeechTooShort = -12053; |
|
198 const TInt KErrAsrNoMatch = -12054; |
|
199 const TInt KErrAsrDataRightViolation = -12055; |
|
200 const TInt KErrAsrNotRegisted = -12056; |
|
201 const TInt KErrAsrInvalidState = -12057; |
|
202 const TInt KErrAsrInitializationFailure = -12058; |
|
203 |
|
204 // Pre-defined Engine Parameter Identifiers starts from index 0x01 |
|
205 // User-define Engine Parameter Identifiers starts from index 0x10000 and end at index KMaxTInt. |
|
206 const TInt KRecognizerMode = 0x01; |
|
207 const TInt KGrammarSupport = 0x02; |
|
208 const TInt KLoadMultipleGrammars = 0x03; |
|
209 const TInt KLoadMultipleLexicons = 0x04; |
|
210 const TInt KLoadMultipleModelBanks = 0x05; |
|
211 const TInt KModelStorageCapacity = 0x06; |
|
212 const TInt KMaxLoadableModels = 0x07; |
|
213 const TInt KMaxFrontEndBackEndDelay = 0x08; |
|
214 const TInt KSamplingRate = 0x09; |
|
215 const TInt KBitsPerSample = 0x0A; |
|
216 |
|
217 // Lexicon reference counter identifier |
|
218 const TInt KLexiconReferenceCounter = 0x0B; |
|
219 |
|
220 |
|
221 enum TNSSRecognitionMode |
|
222 { |
|
223 ENSSSdMode, |
|
224 ENSSSiMode, |
|
225 ENSSSdSiMode |
|
226 }; |
|
227 |
|
228 #endif // NSSSISPEECHRECOGNITIONDATACOMMON_H |