|
1 /* |
|
2 * Copyright (c) 2002 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: ARM hardware device for grammar compiling |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 #ifndef ASRADAPTATIONHWDEVICE_H |
|
24 #define ASRADAPTATIONHWDEVICE_H |
|
25 |
|
26 // INCLUDES |
|
27 #include <asrshwdevice.h> |
|
28 #include <nsssispeechrecognitiondatadevasr.h> |
|
29 |
|
30 // Implementation |
|
31 class CAsrAdaptationAlgorithm; |
|
32 |
|
33 // CLASS DECLARATION |
|
34 /** |
|
35 * Callback class for adaptation. |
|
36 * |
|
37 * !!@lib asrsadaptationhwdevice.lib |
|
38 * @since 2.8 |
|
39 */ |
|
40 class MASRAdaptationHwDeviceObserver |
|
41 { |
|
42 public: |
|
43 /**!!! |
|
44 * |
|
45 * @since 2.8 |
|
46 * @param none |
|
47 * @return |
|
48 */ |
|
49 |
|
50 virtual void MaahdAdaptationComplete(TInt aError) = 0; |
|
51 }; |
|
52 |
|
53 |
|
54 |
|
55 /** |
|
56 * Adaptation class |
|
57 * |
|
58 * !!@lib asrsadaptationhwdevice.lib |
|
59 * @since 2.8 |
|
60 */ |
|
61 class CASRSAdaptHwDevice : public CASRSHwDevice |
|
62 { |
|
63 public: // Constructors and destructor |
|
64 |
|
65 /** |
|
66 * Two-phased constructor. |
|
67 */ |
|
68 IMPORT_C static CASRSAdaptHwDevice* NewL( |
|
69 MASRAdaptationHwDeviceObserver& aObserver ); |
|
70 |
|
71 /** |
|
72 * Destructor. |
|
73 */ |
|
74 IMPORT_C virtual ~CASRSAdaptHwDevice(); |
|
75 |
|
76 public: // New functions |
|
77 |
|
78 /** |
|
79 * Retrieve a custom interface |
|
80 * @since 2.8 |
|
81 * @param none |
|
82 * @return Pointer to a custom interface |
|
83 */ |
|
84 IMPORT_C TAny* CustomInterface(TUid aInterfaceId); |
|
85 |
|
86 /** |
|
87 * Initializes the device. Subsequent calls reset the device. |
|
88 * @since 2.8 |
|
89 * @param none |
|
90 * @return none |
|
91 */ |
|
92 IMPORT_C void InitializeL(); |
|
93 |
|
94 /** |
|
95 * Clears the device. |
|
96 * @since 2.8 |
|
97 * @param none |
|
98 * @return none |
|
99 */ |
|
100 IMPORT_C void Clear(); |
|
101 |
|
102 |
|
103 /** |
|
104 * Start the adaptation. It will adapt the acoustic models given the feature vector set and phoneme sequences |
|
105 * of a correctly recognized utterance |
|
106 * @since 2.8 |
|
107 * @param aAdaptationData: Buffer that stores data(feature vector) for the speaker adaptation. |
|
108 * @param aModelBank: Model bank, which is the acoustic model to be adapted. |
|
109 * @param aPronunciation: Pronunciation of the adaptation utterance. |
|
110 * @param aLanguage : adaptation language |
|
111 * @return none |
|
112 */ |
|
113 IMPORT_C void StartAdaptationL(const TDesC8& aAdaptationData, |
|
114 CSIModelBank& aModelBank, |
|
115 CSIPronunciation& aPronunciation,TLanguage aLanguage); |
|
116 |
|
117 |
|
118 |
|
119 /** |
|
120 * Cancel the Adaptation process. No callback is sent to the client. |
|
121 * @since 2.8 |
|
122 * @param none |
|
123 * @return none |
|
124 */ |
|
125 IMPORT_C void CancelAdaptation(); |
|
126 |
|
127 /** |
|
128 * Cancels adaptation. No callback is sent to the client. |
|
129 * @since 2.8 |
|
130 * @param none |
|
131 * @return none |
|
132 */ |
|
133 /* IMPORT_C void CancelCombination();*/ |
|
134 |
|
135 public: // Functions from base classes |
|
136 |
|
137 /** |
|
138 * From ?base_class ?member_description. |
|
139 * @since ?Series60_version |
|
140 * @param ?arg1 ?description |
|
141 * @return ?description |
|
142 */ |
|
143 //?type ?member_function( ?type ?arg1 ); |
|
144 |
|
145 protected: // New functions |
|
146 |
|
147 /** |
|
148 * ?member_description. |
|
149 * @since ?Series60_version |
|
150 * @param ?arg1 ?description |
|
151 * @return ?description |
|
152 */ |
|
153 //?type ?member_function( ?type ?arg1 ); |
|
154 |
|
155 protected: // Functions from base classes |
|
156 |
|
157 /** |
|
158 * From ?base_class ?member_description |
|
159 */ |
|
160 //?type ?member_function(); |
|
161 |
|
162 private: |
|
163 |
|
164 /** |
|
165 * C++ default constructor. |
|
166 */ |
|
167 CASRSAdaptHwDevice(MASRAdaptationHwDeviceObserver& anObserver); |
|
168 |
|
169 /** |
|
170 * By default Symbian 2nd phase constructor is private. |
|
171 */ |
|
172 void ConstructL(); |
|
173 |
|
174 |
|
175 |
|
176 |
|
177 // Prohibit copy constructor if not deriving from CBase. |
|
178 // CASRGrCompilerHwDevice( const CASRGrCompilerHwDevice& ); |
|
179 // Prohibit assigment operator if not deriving from CBase. |
|
180 // CASRGrCompilerHwDevice& operator=( const CASRGrCompilerHwDevice& ); |
|
181 |
|
182 public: // Data |
|
183 // ?one_line_short_description_of_data |
|
184 //?data_declaration; |
|
185 |
|
186 protected: // Data |
|
187 // ?one_line_short_description_of_data |
|
188 //?data_declaration; |
|
189 |
|
190 private: // Data |
|
191 // pronunciation tree builder algorithm |
|
192 // CPTBAlgorithm* iPtb; |
|
193 |
|
194 // The observer |
|
195 MASRAdaptationHwDeviceObserver& iObserver; |
|
196 |
|
197 // Implementation-specific functions and data |
|
198 CAsrAdaptationAlgorithm *iAlgorithm; |
|
199 |
|
200 // Has Initialize() been called |
|
201 TBool iIsInitialised; |
|
202 |
|
203 // Reserved pointer for future extension. |
|
204 TAny* iReserved; |
|
205 |
|
206 public: // Friend classes |
|
207 //?friend_class_declaration; |
|
208 protected: // Friend classes |
|
209 //?friend_class_declaration; |
|
210 private: // Friend classes |
|
211 //?friend_class_declaration; |
|
212 |
|
213 }; |
|
214 #endif // ?INCLUDE_H |
|
215 |
|
216 // End of File |