1 // Copyright © 2017 winapi-rs developers
2 // Licensed under the Apache License, Version 2.0
3 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
4 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
5 // All files in the project carrying such notice may not be copied, modified, or distributed
6 // except according to those terms.
7 //! SAPI 5.1 definitions
8 use ctypes::{c_char, c_float, c_long, c_short, c_ushort, c_void};
9 use shared::guiddef::{CLSID, GUID, IID, REFCLSID, REFGUID, REFIID};
10 use shared::minwindef::{
11     BOOL, BYTE, DWORD, FILETIME, HKEY, HMODULE, LPARAM, UINT, ULONG, USHORT, WORD, WPARAM
12 };
13 use shared::mmreg::WAVEFORMATEX;
14 use shared::rpcndr::byte;
15 use shared::windef::HWND;
16 use shared::wtypes::{BSTR, VARIANT_BOOL};
17 use shared::wtypesbase::{
18     CLSCTX_INPROC_HANDLER, CLSCTX_INPROC_SERVER, CLSCTX_LOCAL_SERVER, CLSCTX_REMOTE_SERVER
19 };
20 use um::oaidl::{DISPID_NEWENUM, DISPID_VALUE, IDispatch, IDispatchVtbl, VARIANT};
21 use um::objidlbase::{IStream, IStreamVtbl, STREAM_SEEK_CUR, STREAM_SEEK_END, STREAM_SEEK_SET};
22 use um::servprov::{IServiceProvider, IServiceProviderVtbl};
23 use um::unknwnbase::{IUnknown, IUnknownVtbl};
24 use um::winnt::{HANDLE, HRESULT, LONG, LONGLONG, LPCWSTR, LPWSTR, ULONGLONG, WCHAR};
25 ENUM!{enum SPDATAKEYLOCATION {
26     SPDKL_DefaultLocation = 0,
27     SPDKL_CurrentUser = 1,
28     SPDKL_LocalMachine = 2,
29     SPDKL_CurrentConfig = 5,
30 }}
31 pub const SPDUI_EngineProperties: &'static str = "EngineProperties";
32 pub const SPDUI_AddRemoveWord: &'static str = "AddRemoveWord";
33 pub const SPDUI_UserTraining: &'static str = "UserTraining";
34 pub const SPDUI_MicTraining: &'static str = "MicTraining";
35 pub const SPDUI_RecoProfileProperties: &'static str = "RecoProfileProperties";
36 pub const SPDUI_AudioProperties: &'static str = "AudioProperties";
37 pub const SPDUI_AudioVolume: &'static str = "AudioVolume";
38 pub const SPDUI_UserEnrollment: &'static str = "UserEnrollment";
39 pub const SPDUI_ShareData: &'static str = "ShareData";
40 pub const SPDUI_Tutorial: &'static str = "Tutorial";
41 ENUM!{enum SPSTREAMFORMAT {
42     SPSF_Default = -1i32 as u32,
43     SPSF_NoAssignedFormat = 0,
44     SPSF_Text = 1,
45     SPSF_NonStandardFormat = 2,
46     SPSF_ExtendedAudioFormat = 3,
47     SPSF_8kHz8BitMono = 4,
48     SPSF_8kHz8BitStereo = 5,
49     SPSF_8kHz16BitMono = 6,
50     SPSF_8kHz16BitStereo = 7,
51     SPSF_11kHz8BitMono = 8,
52     SPSF_11kHz8BitStereo = 9,
53     SPSF_11kHz16BitMono = 10,
54     SPSF_11kHz16BitStereo = 11,
55     SPSF_12kHz8BitMono = 12,
56     SPSF_12kHz8BitStereo = 13,
57     SPSF_12kHz16BitMono = 14,
58     SPSF_12kHz16BitStereo = 15,
59     SPSF_16kHz8BitMono = 16,
60     SPSF_16kHz8BitStereo = 17,
61     SPSF_16kHz16BitMono = 18,
62     SPSF_16kHz16BitStereo = 19,
63     SPSF_22kHz8BitMono = 20,
64     SPSF_22kHz8BitStereo = 21,
65     SPSF_22kHz16BitMono = 22,
66     SPSF_22kHz16BitStereo = 23,
67     SPSF_24kHz8BitMono = 24,
68     SPSF_24kHz8BitStereo = 25,
69     SPSF_24kHz16BitMono = 26,
70     SPSF_24kHz16BitStereo = 27,
71     SPSF_32kHz8BitMono = 28,
72     SPSF_32kHz8BitStereo = 29,
73     SPSF_32kHz16BitMono = 30,
74     SPSF_32kHz16BitStereo = 31,
75     SPSF_44kHz8BitMono = 32,
76     SPSF_44kHz8BitStereo = 33,
77     SPSF_44kHz16BitMono = 34,
78     SPSF_44kHz16BitStereo = 35,
79     SPSF_48kHz8BitMono = 36,
80     SPSF_48kHz8BitStereo = 37,
81     SPSF_48kHz16BitMono = 38,
82     SPSF_48kHz16BitStereo = 39,
83     SPSF_TrueSpeech_8kHz1BitMono = 40,
84     SPSF_CCITT_ALaw_8kHzMono = 41,
85     SPSF_CCITT_ALaw_8kHzStereo = 42,
86     SPSF_CCITT_ALaw_11kHzMono = 43,
87     SPSF_CCITT_ALaw_11kHzStereo = 44,
88     SPSF_CCITT_ALaw_22kHzMono = 45,
89     SPSF_CCITT_ALaw_22kHzStereo = 46,
90     SPSF_CCITT_ALaw_44kHzMono = 47,
91     SPSF_CCITT_ALaw_44kHzStereo = 48,
92     SPSF_CCITT_uLaw_8kHzMono = 49,
93     SPSF_CCITT_uLaw_8kHzStereo = 50,
94     SPSF_CCITT_uLaw_11kHzMono = 51,
95     SPSF_CCITT_uLaw_11kHzStereo = 52,
96     SPSF_CCITT_uLaw_22kHzMono = 53,
97     SPSF_CCITT_uLaw_22kHzStereo = 54,
98     SPSF_CCITT_uLaw_44kHzMono = 55,
99     SPSF_CCITT_uLaw_44kHzStereo = 56,
100     SPSF_ADPCM_8kHzMono = 57,
101     SPSF_ADPCM_8kHzStereo = 58,
102     SPSF_ADPCM_11kHzMono = 59,
103     SPSF_ADPCM_11kHzStereo = 60,
104     SPSF_ADPCM_22kHzMono = 61,
105     SPSF_ADPCM_22kHzStereo = 62,
106     SPSF_ADPCM_44kHzMono = 63,
107     SPSF_ADPCM_44kHzStereo = 64,
108     SPSF_GSM610_8kHzMono = 65,
109     SPSF_GSM610_11kHzMono = 66,
110     SPSF_GSM610_22kHzMono = 67,
111     SPSF_GSM610_44kHzMono = 68,
112     SPSF_NUM_FORMATS = 69,
113 }}
114 extern {
115     pub static SPDFID_Text: GUID;
116     pub static SPDFID_WaveFormatEx: GUID;
117 }
118 pub const SPREG_USER_ROOT: &'static str = "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Speech";
119 pub const SPREG_LOCAL_MACHINE_ROOT: &'static str
120     = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech";
121 pub const SPCAT_AUDIOOUT: &'static str
122     = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\AudioOutput";
123 pub const SPCAT_AUDIOIN: &'static str
124     = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\AudioInput";
125 pub const SPCAT_VOICES: &'static str = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\Voices";
126 pub const SPCAT_RECOGNIZERS: &'static str
127     = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\Recognizers";
128 pub const SPCAT_APPLEXICONS: &'static str
129     = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\AppLexicons";
130 pub const SPCAT_PHONECONVERTERS: &'static str
131     = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\PhoneConverters";
132 pub const SPCAT_TEXTNORMALIZERS: &'static str
133     = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\TextNormalizers";
134 pub const SPCAT_RECOPROFILES: &'static str
135     = "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Speech\\RecoProfiles";
136 pub const SPMMSYS_AUDIO_IN_TOKEN_ID: &'static str
137     = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\AudioInput\\TokenEnums\\MMAudioIn\\";
138 pub const SPMMSYS_AUDIO_OUT_TOKEN_ID: &'static str
139     = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\AudioOutput\\TokenEnums\\MMAudioOut\\";
140 pub const SPCURRENT_USER_LEXICON_TOKEN_ID: &'static str
141     = "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Speech\\CurrentUserLexicon";
142 pub const SPCURRENT_USER_SHORTCUT_TOKEN_ID: &'static str
143     = "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Speech\\CurrentUserShortcut";
144 pub const SPTOKENVALUE_CLSID: &'static str = "CLSID";
145 pub const SPTOKENKEY_FILES: &'static str = "Files";
146 pub const SPTOKENKEY_UI: &'static str = "UI";
147 pub const SPTOKENKEY_ATTRIBUTES: &'static str = "Attributes";
148 pub const SPVOICECATEGORY_TTSRATE: &'static str = "DefaultTTSRate";
149 pub const SPPROP_RESOURCE_USAGE: &'static str = "ResourceUsage";
150 pub const SPPROP_HIGH_CONFIDENCE_THRESHOLD: &'static str = "HighConfidenceThreshold";
151 pub const SPPROP_NORMAL_CONFIDENCE_THRESHOLD: &'static str = "NormalConfidenceThreshold";
152 pub const SPPROP_LOW_CONFIDENCE_THRESHOLD: &'static str = "LowConfidenceThreshold";
153 pub const SPPROP_RESPONSE_SPEED: &'static str = "ResponseSpeed";
154 pub const SPPROP_COMPLEX_RESPONSE_SPEED: &'static str = "ComplexResponseSpeed";
155 pub const SPPROP_ADAPTATION_ON: &'static str = "AdaptationOn";
156 pub const SPPROP_PERSISTED_BACKGROUND_ADAPTATION: &'static str = "PersistedBackgroundAdaptation";
157 pub const SPPROP_PERSISTED_LANGUAGE_MODEL_ADAPTATION: &'static str
158     = "PersistedLanguageModelAdaptation";
159 pub const SPPROP_UX_IS_LISTENING: &'static str = "UXIsListening";
160 pub const SPTOPIC_SPELLING: &'static str = "Spelling";
161 pub const SPWILDCARD: &'static str = "...";
162 pub const SPDICTATION: &'static str = "*";
163 pub const SPINFDICTATION: &'static str = "*+";
164 pub const SP_LOW_CONFIDENCE: c_char = -1;
165 pub const SP_NORMAL_CONFIDENCE: c_char = 0;
166 pub const SP_HIGH_CONFIDENCE: c_char = 1;
167 pub const DEFAULT_WEIGHT: c_float = 1.0;
168 pub const SP_MAX_WORD_LENGTH: ULONG = 128;
169 pub const SP_MAX_PRON_LENGTH: ULONG = 384;
170 RIDL!(#[uuid(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)]
171 interface ISpNotifyCallback(ISpNotifyCallbackVtbl) {
172     fn NotifyCallback(
173         wParam: WPARAM,
174         lParam: LPARAM,
175     ) -> HRESULT,
176 });
177 FN!(
178         stdcall SPNOTIFYCALLBACK(wParam: WPARAM, lParam: LPARAM,
179     ) -> ());
180 RIDL!(#[uuid(0x5eff4aef, 0x8487, 0x11d2, 0x96, 0x1c, 0x00, 0xc0, 0x4f, 0x8e, 0xe6, 0x28)]
181 interface ISpNotifySource(ISpNotifySourceVtbl): IUnknown(IUnknownVtbl) {
182     fn SetNotifySink(
183         pNotifySink: *mut ISpNotifySink,
184     ) -> HRESULT,
185     fn SetNotifyWindowMessage(
186         hWnd: HWND,
187         Msg: UINT,
188         wParam: WPARAM,
189         lParam: LPARAM,
190     ) -> HRESULT,
191     fn SetNotifyCallbackFunction(
192         pfnCallback: SPNOTIFYCALLBACK,
193         wParam: WPARAM,
194         lParam: LPARAM,
195     ) -> HRESULT,
196     fn SetNotifyCallbackInterface(
197         pSpCallback: *mut ISpNotifyCallback,
198         wParam: WPARAM,
199         lParam: LPARAM,
200     ) -> HRESULT,
201     fn SetNotifyWin32Event() -> HRESULT,
202     fn WaitForNotifyEvent(
203         dwMilliseconds: DWORD,
204     ) -> HRESULT,
205     fn GetNotifyEventHandle() -> HANDLE,
206 });
207 RIDL!(#[uuid(0x259684dc, 0x37c3, 0x11d2, 0x96, 0x03, 0x00, 0xc0, 0x4f, 0x8e, 0xe6, 0x28)]
208 interface ISpNotifySink(ISpNotifySinkVtbl): IUnknown(IUnknownVtbl) {
209     fn Notify() -> HRESULT,
210 });
211 RIDL!(#[uuid(0xaca16614, 0x5d3d, 0x11d2, 0x96, 0x0e, 0x00, 0xc0, 0x4f, 0x8e, 0xe6, 0x28)]
212 interface ISpNotifyTranslator(ISpNotifyTranslatorVtbl): ISpNotifySink(ISpNotifySinkVtbl) {
213     fn InitWindowMessage(
214         hWnd: HWND,
215         Msg: UINT,
216         wParam: WPARAM,
217         lParam: LPARAM,
218     ) -> HRESULT,
219     fn InitCallback(
220         pfnCallback: SPNOTIFYCALLBACK,
221         wParam: WPARAM,
222         lParam: LPARAM,
223     ) -> HRESULT,
224     fn InitSpNotifyCallback(
225         pSpCallback: *mut ISpNotifyCallback,
226         wParam: WPARAM,
227         lParam: LPARAM,
228     ) -> HRESULT,
229     fn InitWin32Event(
230         hEvent: HANDLE,
231         fCloseHandleOnRelease: BOOL,
232     ) -> HRESULT,
233     fn Wait(
234         dwMilliseconds: DWORD,
235     ) -> HRESULT,
236     fn GetEventHandle() -> HANDLE,
237 });
238 RIDL!(#[uuid(0x14056581, 0xe16c, 0x11d2, 0xbb, 0x90, 0x00, 0xc0, 0x4f, 0x8e, 0xe6, 0xc0)]
239 interface ISpDataKey(ISpDataKeyVtbl): IUnknown(IUnknownVtbl) {
240     fn SetData(
241         pszValueName: LPCWSTR,
242         cbData: ULONG,
243         pData: *const BYTE,
244     ) -> HRESULT,
245     fn GetData(
246         pszValueName: LPCWSTR,
247         pcbData: *mut ULONG,
248         pData: *mut BYTE,
249     ) -> HRESULT,
250     fn SetStringValue(
251         pszValueName: LPCWSTR,
252         pszValue: LPCWSTR,
253     ) -> HRESULT,
254     fn GetStringValue(
255         pszValueName: LPCWSTR,
256         ppszValue: *mut LPWSTR,
257     ) -> HRESULT,
258     fn SetDWORD(
259         pszValueName: LPCWSTR,
260         dwValue: DWORD,
261     ) -> HRESULT,
262     fn GetDWORD(
263         pszValueName: LPCWSTR,
264         pdwValue: *mut DWORD,
265     ) -> HRESULT,
266     fn OpenKey(
267         pszSubKeyName: LPCWSTR,
268         ppSubKey: *mut *mut ISpDataKey,
269     ) -> HRESULT,
270     fn CreateKey(
271         pszSubKey: LPCWSTR,
272         ppSubKey: *mut *mut ISpDataKey,
273     ) -> HRESULT,
274     fn DeleteKey(
275         pszSubKey: LPCWSTR,
276     ) -> HRESULT,
277     fn DeleteValue(
278         pszValueName: LPCWSTR,
279     ) -> HRESULT,
280     fn EnumKeys(
281         Index: ULONG,
282         ppszSubKeyName: *mut LPWSTR,
283     ) -> HRESULT,
284     fn EnumValues(
285         Index: ULONG,
286         ppszValueName: *mut LPWSTR,
287     ) -> HRESULT,
288 });
289 RIDL!(#[uuid(0x92a66e2b, 0xc830, 0x4149, 0x83, 0xdf, 0x6f, 0xc2, 0xba, 0x1e, 0x7a, 0x5b)]
290 interface ISpRegDataKey(ISpRegDataKeyVtbl): ISpDataKey(ISpDataKeyVtbl) {
291     fn SetKey(
292         hkey: HKEY,
293         fReadOnly: BOOL,
294     ) -> HRESULT,
295 });
296 RIDL!(#[uuid(0x2d3d3845, 0x39af, 0x4850, 0xbb, 0xf9, 0x40, 0xb4, 0x97, 0x80, 0x01, 0x1d)]
297 interface ISpObjectTokenCategory(ISpObjectTokenCategoryVtbl): ISpDataKey(ISpDataKeyVtbl) {
298     fn SetId(
299         pszCategoryId: LPCWSTR,
300         fCreateIfNotExist: BOOL,
301     ) -> HRESULT,
302     fn GetId(
303         ppszCoMemCategoryId: *mut LPWSTR,
304     ) -> HRESULT,
305     fn GetDataKey(
306         spdkl: SPDATAKEYLOCATION,
307         pppDataKey: *mut *mut ISpDataKey,
308     ) -> HRESULT,
309     fn EnumTokens(
310         pzsReqAttribs: LPCWSTR,
311         pszOptAttribs: LPCWSTR,
312         ppEnum: *mut *mut IEnumSpObjectTokens,
313     ) -> HRESULT,
314     fn SetDefaultTokenId(
315         pszTokenId: LPCWSTR,
316     ) -> HRESULT,
317     fn GetDefaultTokenId(
318         ppszCoMemTokenId: *mut LPWSTR,
319     ) -> HRESULT,
320 });
321 RIDL!(#[uuid(0x14056589, 0xe16c, 0x11d2, 0xbb, 0x90, 0x00, 0xc0, 0x4f, 0x8e, 0xe6, 0xc0)]
322 interface ISpObjectToken(ISpObjectTokenVtbl): ISpDataKey(ISpDataKeyVtbl) {
323     fn SetId(
324         pszCategoryId: LPCWSTR,
325         pszTokenId: LPCWSTR,
326         fCreateIfNotExist: BOOL,
327     ) -> HRESULT,
328     fn GetId(
329         ppszCoMemTokenId: *mut LPWSTR,
330     ) -> HRESULT,
331     fn GetCategory(
332         ppTokenCategory: *mut *mut ISpObjectTokenCategory,
333     ) -> HRESULT,
334     fn CreateInstance(
335         pUnkOuter: *mut IUnknown,
336         dwClsContext: DWORD,
337         riid: REFIID,
338         ppvObject: *mut *mut c_void,
339     ) -> HRESULT,
340     fn GetStorageFileName(
341         clsidCaller: REFCLSID,
342         pszValueName: LPCWSTR,
343         pszFileNameSpecifier: LPCWSTR,
344         nFolder: ULONG,
345         ppszFilePath: *mut LPWSTR,
346     ) -> HRESULT,
347     fn RemoveStorageFileName(
348         pszKeyName: LPCWSTR,
349         fDeleteFile: BOOL,
350     ) -> HRESULT,
351     fn Remove(
352         pclsidCaller: *const CLSID,
353     ) -> HRESULT,
354     fn IsUISupported(
355         pszTypeOfUI: LPCWSTR,
356         pvExtraData: *mut c_void,
357         cbExtraData: ULONG,
358         punkObject: *mut IUnknown,
359         pfSupported: *mut BOOL,
360     ) -> HRESULT,
361     fn DisplayUI(
362         hwndParent: HWND,
363         pszTitle: LPCWSTR,
364         pszTypeOfUI: LPCWSTR,
365         pvExtraData: *mut c_void,
366         cbExtraData: ULONG,
367         punkObject: *mut IUnknown,
368     ) -> HRESULT,
369     fn MatchesAttributes(
370         pszAttributes: LPCWSTR,
371         pfMatches: *mut BOOL,
372     ) -> HRESULT,
373 });
374 RIDL!(#[uuid(0xb8aab0cf, 0x346f, 0x49d8, 0x94, 0x99, 0xc8, 0xb0, 0x3f, 0x16, 0x1d, 0x51)]
375 interface ISpObjectTokenInit(ISpObjectTokenInitVtbl): ISpObjectToken(ISpObjectTokenVtbl) {
376     fn InitFromDataKey(
377         pszCategoryId: LPCWSTR,
378         pszTokenId: LPCWSTR,
379         pDataKey: *mut ISpDataKey,
380     ) -> HRESULT,
381 });
382 RIDL!(#[uuid(0x06b64f9e, 0x7fda, 0x11d2, 0xb4, 0xf2, 0x00, 0xc0, 0x4f, 0x79, 0x73, 0x96)]
383 interface IEnumSpObjectTokens(IEnumSpObjectTokensVtbl): IUnknown(IUnknownVtbl) {
384     fn Next(
385         celt: ULONG,
386         pelt: *mut *mut ISpObjectToken,
387         pceltFetched: *mut ULONG,
388     ) -> HRESULT,
389     fn Skip(
390         celt: ULONG,
391     ) -> HRESULT,
392     fn Reset() -> HRESULT,
393     fn Clone(
394         ppEnum: *mut *mut IEnumSpObjectTokens,
395     ) -> HRESULT,
396     fn Item(
397         Index: ULONG,
398         ppToken: *mut *mut ISpObjectToken,
399     ) -> HRESULT,
400     fn GetCount(
401         pCount: *mut ULONG,
402     ) -> HRESULT,
403 });
404 RIDL!(#[uuid(0x5b559f40, 0xe952, 0x11d2, 0xbb, 0x91, 0x00, 0xc0, 0x4f, 0x8e, 0xe6, 0xc0)]
405 interface ISpObjectWithToken(ISpObjectWithTokenVtbl): IUnknown(IUnknownVtbl) {
406     fn SetObjectToken(
407         pToken: *mut ISpObjectToken,
408     ) -> HRESULT,
409     fn GetObjectToken(
410         ppToken: *mut *mut ISpObjectToken,
411     ) -> HRESULT,
412 });
413 RIDL!(#[uuid(0x93384e18, 0x5014, 0x43d5, 0xad, 0xbb, 0xa7, 0x8e, 0x05, 0x59, 0x26, 0xbd)]
414 interface ISpResourceManager(ISpResourceManagerVtbl): IServiceProvider(IServiceProviderVtbl) {
415     fn SetObject(
416         guidServiceId: REFGUID,
417         pUnkObject: *mut IUnknown,
418     ) -> HRESULT,
419     fn GetObject(
420         guidServiceId: REFGUID,
421         ObjectCLSID: REFCLSID,
422         ObjectIID: REFIID,
423         fReleaseWhenLastExternalRefReleased: BOOL,
424         ppObject: *mut *mut c_void,
425     ) -> HRESULT,
426 });
427 ENUM!{enum SPEVENTLPARAMTYPE {
428     SPET_LPARAM_IS_UNDEFINED = 0,
429     SPET_LPARAM_IS_TOKEN,
430     SPET_LPARAM_IS_OBJECT,
431     SPET_LPARAM_IS_POINTER,
432     SPET_LPARAM_IS_STRING,
433 }}
434 ENUM!{enum SPEVENTENUM {
435     SPEI_UNDEFINED = 0,
436     SPEI_START_INPUT_STREAM = 1,
437     SPEI_END_INPUT_STREAM = 2,
438     SPEI_VOICE_CHANGE = 3,
439     SPEI_TTS_BOOKMARK = 4,
440     SPEI_WORD_BOUNDARY = 5,
441     SPEI_PHONEME = 6,
442     SPEI_SENTENCE_BOUNDARY = 7,
443     SPEI_VISEME = 8,
444     SPEI_TTS_AUDIO_LEVEL = 9,
445     SPEI_TTS_PRIVATE = 15,
446     SPEI_MIN_TTS = 1,
447     SPEI_MAX_TTS = 15,
448     SPEI_END_SR_STREAM = 34,
449     SPEI_SOUND_START = 35,
450     SPEI_SOUND_END = 36,
451     SPEI_PHRASE_START = 37,
452     SPEI_RECOGNITION = 38,
453     SPEI_HYPOTHESIS = 39,
454     SPEI_SR_BOOKMARK = 40,
455     SPEI_PROPERTY_NUM_CHANGE = 41,
456     SPEI_PROPERTY_STRING_CHANGE = 42,
457     SPEI_FALSE_RECOGNITION = 43,
458     SPEI_INTERFERENCE = 44,
459     SPEI_REQUEST_UI = 45,
460     SPEI_RECO_STATE_CHANGE = 46,
461     SPEI_ADAPTATION = 47,
462     SPEI_START_SR_STREAM = 48,
463     SPEI_RECO_OTHER_CONTEXT = 49,
464     SPEI_SR_AUDIO_LEVEL = 50,
465     SPEI_SR_PRIVATE = 52,
466     SPEI_MIN_SR = 34,
467     SPEI_MAX_SR = 52,
468     SPEI_RESERVED1 = 30,
469     SPEI_RESERVED2 = 33,
470     SPEI_RESERVED3 = 63,
471 }}
472 pub const SPFEI_FLAGCHECK: ULONGLONG = (1 << SPEI_RESERVED1) | (1 << SPEI_RESERVED2);
473 pub const SPFEI_ALL_TTS_EVENTS: ULONGLONG = 0x000000000000FFFE | SPFEI_FLAGCHECK;
474 pub const SPFEI_ALL_SR_EVENTS: ULONGLONG = 0x003FFFFC00000000 | SPFEI_FLAGCHECK;
475 pub const SPFEI_ALL_EVENTS: ULONGLONG = 0xEFFFFFFFFFFFFFFF;
476 #[inline]
477 pub fn SPFEI(
478         SPEI_ord: SPEVENTENUM,
479     ) -> ULONGLONG {
480     (1 << SPEI_ord) | SPFEI_FLAGCHECK
481 }
482 STRUCT!{struct SPEVENT {
483     bitfields: DWORD,
484     ulStreamNum: ULONG,
485     ullAudioStreamOffset: ULONGLONG,
486     wParam: WPARAM,
487     lParam: LPARAM,
488 }}
489 BITFIELD!{SPEVENT bitfields: SPEVENTENUM [ eEventId set_eEventId[0..16], ]}
490 BITFIELD!{SPEVENT bitfields: SPEVENTLPARAMTYPE [ elParamType set_elParamType[16..32], ]}
491 STRUCT!{struct SPSERIALIZEDEVENT {
492     bitfields: DWORD,
493     ulStreamNum: ULONG,
494     ullAudioStreamOffset: ULONGLONG,
495     SerializedwParam: ULONG,
496     SerializedlParam: LONG,
497 }}
498 BITFIELD!{SPSERIALIZEDEVENT bitfields: SPEVENTENUM [ eEventId set_eEventId[0..16], ]}
499 BITFIELD!{SPSERIALIZEDEVENT bitfields: SPEVENTLPARAMTYPE [ elParamType set_elParamType[16..32], ]}
500 STRUCT!{struct SPSERIALIZEDEVENT64 {
501     bitfields: DWORD,
502     ulStreamNum: ULONG,
503     ullAudioStreamOffset: ULONGLONG,
504     SerializedwParam: ULONGLONG,
505     SerializedlParam: LONGLONG,
506 }}
507 BITFIELD!{SPSERIALIZEDEVENT64 bitfields: SPEVENTENUM [
508     eEventId set_eEventId[0..16],
509 ]}
510 BITFIELD!{SPSERIALIZEDEVENT64 bitfields: SPEVENTLPARAMTYPE [
511     elParamType set_elParamType[16..32],
512 ]}
513 ENUM!{enum SPINTERFERENCE {
514     SPINTERFERENCE_NONE = 0,
515     SPINTERFERENCE_NOISE,
516     SPINTERFERENCE_NOSIGNAL,
517     SPINTERFERENCE_TOOLOUD,
518     SPINTERFERENCE_TOOQUIET,
519     SPINTERFERENCE_TOOFAST,
520     SPINTERFERENCE_TOOSLOW,
521     SPINTERFERENCE_LATENCY_WARNING,
522     SPINTERFERENCE_LATENCY_TRUNCATE_BEGIN ,
523     SPINTERFERENCE_LATENCY_TRUNCATE_END,
524 }}
525 ENUM!{enum SPENDSRSTREAMFLAGS {
526     SPESF_NONE = 0,
527     SPESF_STREAM_RELEASED = 1 << 0,
528     SPESF_EMULATED = 1 << 1,
529 }}
530 ENUM!{enum SPVFEATURE {
531     SPVFEATURE_STRESSED = 1 << 0,
532     SPVFEATURE_EMPHASIS = 1 << 1,
533 }}
534 ENUM!{enum SPVISEMES {
535     SP_VISEME_0 = 0,
536     SP_VISEME_1,
537     SP_VISEME_2,
538     SP_VISEME_3,
539     SP_VISEME_4,
540     SP_VISEME_5,
541     SP_VISEME_6,
542     SP_VISEME_7,
543     SP_VISEME_8,
544     SP_VISEME_9,
545     SP_VISEME_10,
546     SP_VISEME_11,
547     SP_VISEME_12,
548     SP_VISEME_13,
549     SP_VISEME_14,
550     SP_VISEME_15,
551     SP_VISEME_16,
552     SP_VISEME_17,
553     SP_VISEME_18,
554     SP_VISEME_19,
555     SP_VISEME_20,
556     SP_VISEME_21,
557 }}
558 STRUCT!{struct SPEVENTSOURCEINFO {
559     ullEventInterest: ULONGLONG,
560     ullQueuedInterest: ULONGLONG,
561     ulCount: ULONG,
562 }}
563 RIDL!(#[uuid(0xbe7a9cce, 0x5f9e, 0x11d2, 0x96, 0x0f, 0x00, 0xc0, 0x4f, 0x8e, 0xe6, 0x28)]
564 interface ISpEventSource(ISpEventSourceVtbl): ISpNotifySource(ISpNotifySourceVtbl) {
565     fn SetInterest(
566         ullEventInterest: ULONGLONG,
567         ullQueuedInterest: ULONGLONG,
568     ) -> HRESULT,
569     fn GetEvents(
570         ulCount: ULONG,
571         pEventArray: *mut SPEVENT,
572         pulFetched: *mut ULONG,
573     ) -> HRESULT,
574     fn GetInfo(
575         pInfo: *mut SPEVENTSOURCEINFO,
576     ) -> HRESULT,
577 });
578 RIDL!(#[uuid(0xbe7a9cc9, 0x5f9e, 0x11d2, 0x96, 0x0f, 0x00, 0xc0, 0x4f, 0x8e, 0xe6, 0x28)]
579 interface ISpEventSink(ISpEventSinkVtbl): IUnknown(IUnknownVtbl) {
580     fn AddEvents(
581         pEventArray: *const SPEVENT,
582         ulCount: ULONG,
583     ) -> HRESULT,
584     fn GetEventInterest(
585         pullEventInterest: *mut ULONGLONG,
586     ) -> HRESULT,
587 });
588 RIDL!(#[uuid(0xbed530be, 0x2606, 0x4f4d, 0xa1, 0xc0, 0x54, 0xc5, 0xcd, 0xa5, 0x56, 0x6f)]
589 interface ISpStreamFormat(ISpStreamFormatVtbl): IStream(IStreamVtbl) {
590     fn GetFormat(
591         pguidFormatId: *mut GUID,
592         ppCoMemWaveFormatEx: *mut *mut WAVEFORMATEX,
593     ) -> HRESULT,
594 });
595 ENUM!{enum SPFILEMODE {
596     SPFM_OPEN_READONLY,
597     SPFM_OPEN_READWRITE,
598     SPFM_CREATE,
599     SPFM_CREATE_ALWAYS,
600     SPFM_NUM_MODES,
601 }}
602 RIDL!(#[uuid(0x12e3cca9, 0x7518, 0x44c5, 0xa5, 0xe7, 0xba, 0x5a, 0x79, 0xcb, 0x92, 0x9e)]
603 interface ISpStream(ISpStreamVtbl): ISpStreamFormat(ISpStreamFormatVtbl) {
604     fn SetBaseStream(
605         pStream: *mut IStream,
606         rguidFormat: REFGUID,
607         pWaveFormatEx: *const WAVEFORMATEX,
608     ) -> HRESULT,
609     fn GetBaseStream(
610         ppStream: *mut *mut IStream,
611     ) -> HRESULT,
612     fn BindToFile(
613         pszFileName: LPCWSTR,
614         eMode: SPFILEMODE,
615         pFormatId: *const GUID,
616         pWaveFormatEx: *const WAVEFORMATEX,
617         ullEventInterest: ULONGLONG,
618     ) -> HRESULT,
619     fn Close() -> HRESULT,
620 });
621 RIDL!(#[uuid(0x678a932c, 0xea71, 0x4446, 0x9b, 0x41, 0x78, 0xfd, 0xa6, 0x28, 0x0a, 0x29)]
622 interface ISpStreamFormatConverter(ISpStreamFormatConverterVtbl):
623     ISpStreamFormat(ISpStreamFormatVtbl) {
624     fn SetBaseStream(
625         pStream: *mut ISpStreamFormat,
626         fSetFormatToBaseStreamFormat: BOOL,
627         fWriteToBaseStream: BOOL,
628     ) -> HRESULT,
629     fn GetBaseStream(
630         ppStream: *mut *mut ISpStreamFormat,
631     ) -> HRESULT,
632     fn SetFormat(
633         rguidFormatIdOfConvertedStream: REFGUID,
634         pWaveFormatExOfConvertedStream: *const WAVEFORMATEX,
635     ) -> HRESULT,
636     fn ResetSeekPosition() -> HRESULT,
637     fn ScaleConvertedToBaseOffset(
638         ullOffsetConvertedStream: ULONGLONG,
639         pullOffsetBaseStream: *mut ULONGLONG,
640     ) -> HRESULT,
641     fn ScaleBaseToConvertedOffset(
642         ullOffsetBaseStream: ULONGLONG,
643         pullOffsetConvertedStream: *mut ULONGLONG,
644     ) -> HRESULT,
645 });
646 ENUM!{enum SPAUDIOSTATE {
647     SPAS_CLOSED,
648     SPAS_STOP,
649     SPAS_PAUSE,
650     SPAS_RUN,
651 }}
652 STRUCT!{struct SPAUDIOSTATUS {
653     cbFreeBuffSpace: c_long,
654     cbNonBlockingIO: ULONG,
655     State: SPAUDIOSTATE,
656     CurSeekPos: ULONGLONG,
657     CurDevicePos: ULONGLONG,
658     dwAudioLevel: DWORD,
659     dwReserved2: DWORD,
660 }}
661 STRUCT!{struct SPAUDIOBUFFERINFO {
662     ulMsMinNotification: ULONG,
663     ulMsBufferSize: ULONG,
664     ulMsEventBias: ULONG,
665 }}
666 RIDL!(#[uuid(0xc05c768f, 0xfae8, 0x4ec2, 0x8e, 0x07, 0x33, 0x83, 0x21, 0xc1, 0x24, 0x52)]
667 interface ISpAudio(ISpAudioVtbl): ISpStreamFormat(ISpStreamFormatVtbl) {
668     fn SetState(
669         NewState: SPAUDIOSTATE,
670         ullReserved: ULONGLONG,
671     ) -> HRESULT,
672     fn SetFormat(
673         rguidFmtId: REFGUID,
674         pWaveFormatEx: *const WAVEFORMATEX,
675     ) -> HRESULT,
676     fn GetStatus(
677         pStatus: *mut SPAUDIOSTATUS,
678     ) -> HRESULT,
679     fn SetBufferInfo(
680         pBuffInfo: *const SPAUDIOBUFFERINFO,
681     ) -> HRESULT,
682     fn GetBufferInfo(
683         pBuffInfo: *mut SPAUDIOBUFFERINFO,
684     ) -> HRESULT,
685     fn GetDefaultFormat(
686         pFormatId: *mut GUID,
687         ppCoMemWaveFormatEx: *mut *mut WAVEFORMATEX,
688     ) -> HRESULT,
689     fn EventHandle() -> HANDLE,
690     fn GetVolumeLevel(
691         pLevel: *mut ULONG,
692     ) -> HRESULT,
693     fn SetVolumeLevel(
694         Level: ULONG,
695     ) -> HRESULT,
696     fn GetBufferNotifySize(
697         pcbSize: *mut ULONG,
698     ) -> HRESULT,
699     fn SetBufferNotifySize(
700         cbSize: ULONG,
701     ) -> HRESULT,
702 });
703 RIDL!(#[uuid(0x15806f6e, 0x1d70, 0x4b48, 0x98, 0xe6, 0x3b, 0x1a, 0x00, 0x75, 0x09, 0xab)]
704 interface ISpMMSysAudio(ISpMMSysAudioVtbl): ISpAudio(ISpAudioVtbl) {
705     fn GetDeviceId(
706         puDeviceId: *mut UINT,
707     ) -> HRESULT,
708     fn SetDeviceId(
709         uDeviceId: UINT,
710     ) -> HRESULT,
711     fn GetMMHandle(
712         pHandle: *mut *mut c_void,
713     ) -> HRESULT,
714     fn GetLineId(
715         puLineId: *mut UINT,
716     ) -> HRESULT,
717     fn SetLineId(
718         uLineId: UINT,
719     ) -> HRESULT,
720 });
721 RIDL!(#[uuid(0x10f63bce, 0x201a, 0x11d3, 0xac, 0x70, 0x00, 0xc0, 0x4f, 0x8e, 0xe6, 0xc0)]
722 interface ISpTranscript(ISpTranscriptVtbl): IUnknown(IUnknownVtbl) {
723     fn GetTranscript(
724         ppszTranscript: *mut LPWSTR,
725     ) -> HRESULT,
726     fn AppendTranscript(
727         pszTranscript: LPCWSTR,
728     ) -> HRESULT,
729 });
730 ENUM!{enum SPDISPLAYATTRIBUTES {
731     SPAF_ONE_TRAILING_SPACE = 0x2,
732     SPAF_TWO_TRAILING_SPACES = 0x4,
733     SPAF_CONSUME_LEADING_SPACES = 0x8,
734     SPAF_ALL = 0xf,
735 }}
736 pub type SPPHONEID = WCHAR;
737 pub type PSPPHONEID = LPWSTR;
738 pub type PCSPPHONEID = LPCWSTR;
739 STRUCT!{struct SPPHRASEELEMENT {
740     ulAudioTimeOffset: ULONG,
741     ulAudioSizeTime: ULONG,
742     ulAudioStreamOffset: ULONG,
743     ulAudioSizeBytes: ULONG,
744     ulRetainedStreamOffset: ULONG,
745     ulRetainedSizeBytes: ULONG,
746     pszDisplayText: LPCWSTR,
747     pszLexicalForm: LPCWSTR,
748     pszPronunciation: *const SPPHONEID,
749     bDisplayAttributes: BYTE,
750     RequiredConfidence: c_char,
751     ActualConfidence: c_char,
752     Reserved: BYTE,
753     SREngineConfidence: c_float,
754 }}
755 STRUCT!{struct SPPHRASERULE {
756     pszName: LPCWSTR,
757     ulId: ULONG,
758     ulFirstElement: ULONG,
759     ulCountOfElements: ULONG,
760     pNextSibling: *const SPPHRASERULE,
761     pFirstChild: *const SPPHRASERULE,
762     SREngineConfidence: c_float,
763     Confidence: c_char,
764 }}
765 ENUM!{enum SPPHRASEPROPERTYUNIONTYPE {
766     SPPPUT_UNUSED = 0,
767     SPPPUT_ARRAY_INDEX,
768 }}
769 STRUCT!{struct SPPHRASEPROPERTY_u_s {
770     bType: byte,
771     bReserved: byte,
772     usArrayIndex: c_ushort,
773 }}
774 UNION!{union SPPHRASEPROPERTY_u {
775     [u32; 1],
776     ulId ulId_mut: ULONG,
777     s s_mut: SPPHRASEPROPERTY_u_s,
778 }}
779 STRUCT!{struct SPPHRASEPROPERTY {
780     pszName: LPCWSTR,
781     u: SPPHRASEPROPERTY_u_s,
782     pszValue: LPCWSTR,
783     vValue: VARIANT,
784     ulFirstElement: ULONG,
785     ulCountOfElements: ULONG,
786     pNextSibling: *const SPPHRASEPROPERTY,
787     pFirstChild: *const SPPHRASEPROPERTY,
788     SREngineConfidence: c_float,
789     Confidence: c_char,
790 }}
791 STRUCT!{struct SPPHRASEREPLACEMENT {
792     bDisplayAttributes: BYTE,
793     pszReplacementText: LPCWSTR,
794     ulFirstElement: ULONG,
795     ulCountOfElements: ULONG,
796 }}
797 STRUCT!{struct SPPHRASE {
798     cbSize: ULONG,
799     LangID: WORD,
800     wHomophoneGroupId: WORD,
801     ullGrammarID: ULONGLONG,
802     ftStartTime: ULONGLONG,
803     ullAudioStreamPosition: ULONGLONG,
804     ulAudioSizeBytes: ULONG,
805     ulRetainedSizeBytes: ULONG,
806     ulAudioSizeTime: ULONG,
807     Rule: SPPHRASERULE,
808     pProperties: *const SPPHRASEPROPERTY,
809     pElements: *const SPPHRASEELEMENT,
810     cReplacements: ULONG,
811     pReplacements: *const SPPHRASEREPLACEMENT,
812     SREngineID: GUID,
813     ulSREnginePrivateDataSize: ULONG,
814     pSREnginePrivateData: *const BYTE,
815 }}
816 STRUCT!{struct SPSERIALIZEDPHRASE {
817     ulSerializedSize: ULONG,
818 }}
819 ENUM!{enum SPVALUETYPE {
820     SPDF_PROPERTY = 0x1,
821     SPDF_REPLACEMENT = 0x2,
822     SPDF_RULE = 0x4,
823     SPDF_DISPLAYTEXT = 0x8,
824     SPDF_LEXICALFORM = 0x10,
825     SPDF_PRONUNCIATION = 0x20,
826     SPDF_AUDIO = 0x40,
827     SPDF_ALTERNATES = 0x80,
828     SPDF_ALL = 0xff,
829 }}
830 STRUCT!{struct SPBINARYGRAMMAR {
831     ulTotalSerializedSize: ULONG,
832 }}
833 ENUM!{enum SPPHRASERNG {
834     SPPR_ALL_ELEMENTS = -1i32 as u32,
835 }}
836 pub const SP_GETWHOLEPHRASE: SPPHRASERNG = SPPR_ALL_ELEMENTS;
837 pub const SPRR_ALL_ELEMENTS: SPPHRASERNG = SPPR_ALL_ELEMENTS;
838 DECLARE_HANDLE!(SPSTATEHANDLE, SPSTATEHANDLE__);
839 ENUM!{enum SPRECOEVENTFLAGS {
840     SPREF_AutoPause = 1 << 0,
841     SPREF_Emulated = 1 << 1,
842 }}
843 ENUM!{enum SPPARTOFSPEECH {
844     SPPS_NotOverriden = -1i32 as u32,
845     SPPS_Unknown = 0,
846     SPPS_Noun = 0x1000,
847     SPPS_Verb = 0x2000,
848     SPPS_Modifier = 0x3000,
849     SPPS_Function = 0x4000,
850     SPPS_Interjection = 0x5000,
851 }}
852 ENUM!{enum SPLEXICONTYPE {
853     eLEXTYPE_USER = 1 << 0,
854     eLEXTYPE_APP = 1 << 1,
855     eLEXTYPE_VENDORLEXICON = 1 << 2,
856     eLEXTYPE_LETTERTOSOUND = 1 << 3,
857     eLEXTYPE_MORPHOLOGY = 1 << 4,
858     eLEXTYPE_RESERVED4 = 1 << 5,
859     eLEXTYPE_USER_SHORTCUT = 1 << 6,
860     eLEXTYPE_RESERVED6 = 1 << 7,
861     eLEXTYPE_RESERVED7 = 1 << 8,
862     eLEXTYPE_RESERVED8 = 1 << 9,
863     eLEXTYPE_RESERVED9 = 1 << 10,
864     eLEXTYPE_RESERVED10 = 1 << 11,
865     eLEXTYPE_PRIVATE1 = 1 << 12,
866     eLEXTYPE_PRIVATE2 = 1 << 13,
867     eLEXTYPE_PRIVATE3 = 1 << 14,
868     eLEXTYPE_PRIVATE4 = 1 << 15,
869     eLEXTYPE_PRIVATE5 = 1 << 16,
870     eLEXTYPE_PRIVATE6 = 1 << 17,
871     eLEXTYPE_PRIVATE7 = 1 << 18,
872     eLEXTYPE_PRIVATE8 = 1 << 19,
873     eLEXTYPE_PRIVATE9 = 1 << 20,
874     eLEXTYPE_PRIVATE10 = 1 << 21,
875     eLEXTYPE_PRIVATE11 = 1 << 22,
876     eLEXTYPE_PRIVATE12 = 1 << 23,
877     eLEXTYPE_PRIVATE13 = 1 << 24,
878     eLEXTYPE_PRIVATE14 = 1 << 25,
879     eLEXTYPE_PRIVATE15 = 1 << 26,
880     eLEXTYPE_PRIVATE16 = 1 << 27,
881     eLEXTYPE_PRIVATE17 = 1 << 28,
882     eLEXTYPE_PRIVATE18 = 1 << 29,
883     eLEXTYPE_PRIVATE19 = 1 << 30,
884     eLEXTYPE_PRIVATE20 = 1 << 31,
885 }}
886 ENUM!{enum SPWORDTYPE {
887     eWORDTYPE_ADDED = 1 << 0,
888     eWORDTYPE_DELETED = 1 << 1,
889 }}
890 STRUCT!{struct SPWORDPRONUNCIATION {
891     pNextWordPronunciation: *mut SPWORDPRONUNCIATION,
892     eLexiconType: SPLEXICONTYPE,
893     LangID: WORD,
894     wPronunciationFlags: WORD,
895     ePartOfSpeech: SPPARTOFSPEECH,
896     szPronunciation: [SPPHONEID; 1],
897 }}
898 STRUCT!{struct SPWORDPRONUNCIATIONLIST {
899     ulSize: ULONG,
900     pvBuffer: *mut BYTE,
901     pFirstWordPronunciation: *mut SPWORDPRONUNCIATION,
902 }}
903 STRUCT!{struct SPWORD {
904     pNextWord: *mut SPWORD,
905     LangID: WORD,
906     wReserved: WORD,
907     eWordType: SPWORDTYPE,
908     pszWord: LPWSTR,
909     pFirstWordPronunciation: *mut SPWORDPRONUNCIATION,
910 }}
911 STRUCT!{struct SPWORDLIST {
912     ulSize: ULONG,
913     pvBuffer: *mut BYTE,
914     pFirstWord: *mut SPWORD,
915 }}
916 RIDL!(#[uuid(0xda41a7c2, 0x5383, 0x4db2, 0x91, 0x6b, 0x6c, 0x17, 0x19, 0xe3, 0xdb, 0x58)]
917 interface ISpLexicon(ISpLexiconVtbl): IUnknown(IUnknownVtbl) {
918     fn GetPronunciations(
919         pszWord: LPCWSTR,
920         LangID: WORD,
921         dwFlags: DWORD,
922         pWordPronunciationList: *mut SPWORDPRONUNCIATIONLIST,
923     ) -> HRESULT,
924     fn AddPronunciation(
925         pszWord: LPCWSTR,
926         LangID: WORD,
927         ePartOfSpeech: SPPARTOFSPEECH,
928         pszPronunciation: PCSPPHONEID,
929     ) -> HRESULT,
930     fn RemovePronunciation(
931         pszWord: LPCWSTR,
932         LangID: WORD,
933         ePartOfSpeech: SPPARTOFSPEECH,
934         pszPronunciation: PCSPPHONEID,
935     ) -> HRESULT,
936     fn GetGeneration(
937         pdwGeneration: *mut DWORD,
938     ) -> HRESULT,
939     fn GetGenerationChange(
940         dwFlags: DWORD,
941         pdwGeneration: *mut DWORD,
942         pWordList: *mut SPWORDLIST,
943     ) -> HRESULT,
944     fn GetWords(
945         dwFlags: DWORD,
946         pdwGeneration: *mut DWORD,
947         pdwCookie: *mut DWORD,
948         pWordList: *mut SPWORDLIST,
949     ) -> HRESULT,
950 });
951 RIDL!(#[uuid(0x8565572f, 0xc094, 0x41cc, 0xb5, 0x6e, 0x10, 0xbd, 0x9c, 0x3f, 0xf0, 0x44)]
952 interface ISpContainerLexicon(ISpContainerLexiconVtbl): ISpLexicon(ISpLexiconVtbl) {
953     fn AddLexicon(
954         pAddLexicon: *mut ISpLexicon,
955         dwFlags: DWORD,
956     ) -> HRESULT,
957 });
958 RIDL!(#[uuid(0x8445c581, 0x0cac, 0x4a38, 0xab, 0xfe, 0x9b, 0x2c, 0xe2, 0x82, 0x64, 0x55)]
959 interface ISpPhoneConverter(ISpPhoneConverterVtbl): ISpObjectWithToken(ISpObjectWithTokenVtbl) {
960     fn PhoneToId(
961         pszPhone: LPCWSTR,
962         pId: *mut SPPHONEID,
963     ) -> HRESULT,
964     fn IdToPhone(
965         pId: PCSPPHONEID,
966         pszPhone: *mut WCHAR,
967     ) -> HRESULT,
968 });
969 STRUCT!{struct SPVPITCH {
970     MiddleAdj: c_long,
971     RangeAdj: c_long,
972 }}
973 ENUM!{enum SPVACTIONS {
974     SPVA_Speak = 0,
975     SPVA_Silence,
976     SPVA_Pronounce,
977     SPVA_Bookmark,
978     SPVA_SpellOut,
979     SPVA_Section,
980     SPVA_ParseUnknownTag,
981 }}
982 STRUCT!{struct SPVCONTEXT {
983     pCategory: LPCWSTR,
984     pBefore: LPCWSTR,
985     pAfter: LPCWSTR,
986 }}
987 STRUCT!{struct SPVSTATE {
988     eAction: SPVACTIONS,
989     LangID: WORD,
990     wReserved: WORD,
991     EmphAdj: c_long,
992     RateAdj: c_long,
993     Volume: ULONG,
994     PitchAdj: SPVPITCH,
995     SilenceMSecs: ULONG,
996     pPhoneIds: *mut SPPHONEID,
997     ePartOfSpeech: SPPARTOFSPEECH,
998     Context: SPVCONTEXT,
999 }}
1000 ENUM!{enum SPRUNSTATE {
1001     SPRS_DONE = 1 << 0,
1002     SPRS_IS_SPEAKING = 1 << 1,
1003 }}
1004 ENUM!{enum SPVLIMITS {
1005     SPMIN_VOLUME = 0,
1006     SPMAX_VOLUME = 100,
1007     SPMIN_RATE = -10i32 as u32,
1008     SPMAX_RATE = 10,
1009 }}
1010 ENUM!{enum SPVPRIORITY {
1011     SPVPRI_NORMAL = 0,
1012     SPVPRI_ALERT = 1 << 0,
1013     SPVPRI_OVER = 1 << 1,
1014 }}
1015 STRUCT!{struct SPVOICESTATUS {
1016     ulCurrentStream: ULONG,
1017     ulLastStreamQueued: ULONG,
1018     hrLastResult: HRESULT,
1019     dwRunningState: DWORD,
1020     ulInputWordPos: ULONG,
1021     ulInputWordLen: ULONG,
1022     ulInputSentPos: ULONG,
1023     ulInputSentLen: ULONG,
1024     lBookmarkId: LONG,
1025     PhonemeId: SPPHONEID,
1026     VisemeId: SPVISEMES,
1027     dwReserved1: DWORD,
1028     dwReserved2: DWORD,
1029 }}
1030 ENUM!{enum SPEAKFLAGS {
1031     SPF_DEFAULT = 0,
1032     SPF_ASYNC = 1 << 0,
1033     SPF_PURGEBEFORESPEAK = 1 << 1,
1034     SPF_IS_FILENAME = 1 << 2,
1035     SPF_IS_XML = 1 << 3,
1036     SPF_IS_NOT_XML = 1 << 4,
1037     SPF_PERSIST_XML = 1 << 5,
1038     SPF_NLP_SPEAK_PUNC = 1 << 6,
1039     SPF_NLP_MASK = SPF_NLP_SPEAK_PUNC,
1040     SPF_VOICE_MASK = SPF_ASYNC | SPF_PURGEBEFORESPEAK
1041         | SPF_IS_FILENAME | SPF_IS_XML | SPF_IS_NOT_XML
1042         | SPF_NLP_MASK | SPF_PERSIST_XML,
1043     SPF_UNUSED_FLAGS = !SPF_VOICE_MASK,
1044 }}
1045 RIDL!(#[uuid(0x6c44df74, 0x72b9, 0x4992, 0xa1, 0xec, 0xef, 0x99, 0x6e, 0x04, 0x22, 0xd4)]
1046 interface ISpVoice(ISpVoiceVtbl): ISpEventSource(ISpEventSourceVtbl) {
1047     fn SetOutput(
1048         pUnkOutput: *mut IUnknown,
1049         fAllowFormatChanges: BOOL,
1050     ) -> HRESULT,
1051     fn GetOutputObjectToken(
1052         ppObjectToken: *mut *mut ISpObjectToken,
1053     ) -> HRESULT,
1054     fn GetOutputStream(
1055         ppStream: *mut *mut ISpStreamFormat,
1056     ) -> HRESULT,
1057     fn Pause() -> HRESULT,
1058     fn Resume() -> HRESULT,
1059     fn SetVoice(
1060         pToken: *mut ISpObjectToken,
1061     ) -> HRESULT,
1062     fn GetVoice(
1063         ppToken: *mut *mut ISpObjectToken,
1064     ) -> HRESULT,
1065     fn Speak(
1066         pwcs: LPCWSTR,
1067         dwFlags: DWORD,
1068         pulStreamNumber: *mut ULONG,
1069     ) -> HRESULT,
1070     fn SpeakStream(
1071         pStream: *mut IStream,
1072         dwFlags: DWORD,
1073         pulStreamNumber: *mut ULONG,
1074     ) -> HRESULT,
1075     fn GetStatus(
1076         pStatus: *mut SPVOICESTATUS,
1077         ppszLastBookmark: *mut LPWSTR,
1078     ) -> HRESULT,
1079     fn Skip(
1080         pItemType: LPCWSTR,
1081         lNumItems: c_long,
1082         pulNumSkipped: *mut ULONG,
1083     ) -> HRESULT,
1084     fn SetPriority(
1085         ePriority: SPVPRIORITY,
1086     ) -> HRESULT,
1087     fn GetPriority(
1088         pePriority: *mut SPVPRIORITY,
1089     ) -> HRESULT,
1090     fn SetAlertBoundary(
1091         eBoundary: SPEVENTENUM,
1092     ) -> HRESULT,
1093     fn GetAlertBoundary(
1094         peBoundary: *mut SPEVENTENUM,
1095     ) -> HRESULT,
1096     fn SetRate(
1097         RateAdjust: c_long,
1098     ) -> HRESULT,
1099     fn GetRate(
1100         pRateAdjust: *mut c_long,
1101     ) -> HRESULT,
1102     fn SetVolume(
1103         usVolume: USHORT,
1104     ) -> HRESULT,
1105     fn GetVolume(
1106         pusVolume: *mut USHORT,
1107     ) -> HRESULT,
1108     fn WaitUntilDone(
1109         msTimeout: ULONG,
1110     ) -> HRESULT,
1111     fn SetSyncSpeakTimeout(
1112         msTimeout: ULONG,
1113     ) -> HRESULT,
1114     fn GetSyncSpeakTimeout(
1115         pmsTimeout: *mut ULONG,
1116     ) -> HRESULT,
1117     fn SpeakCompleteEvent() -> HANDLE,
1118     fn IsUISupported(
1119         pszTypeOfUI: LPCWSTR,
1120         pvExtraData: *mut c_void,
1121         cbExtraData: ULONG,
1122         pfSupported: *mut BOOL,
1123     ) -> HRESULT,
1124     fn DisplayUI(
1125         hwndParent: HWND,
1126         pszTitle: LPCWSTR,
1127         pszTypeOfUI: LPCWSTR,
1128         pvExtraData: *mut c_void,
1129         cbExtraData: ULONG,
1130     ) -> HRESULT,
1131 });
1132 RIDL!(#[uuid(0x1a5c0354, 0xb621, 0x4b5a, 0x87, 0x91, 0xd3, 0x06, 0xed, 0x37, 0x9e, 0x53)]
1133 interface ISpPhrase(ISpPhraseVtbl): IUnknown(IUnknownVtbl) {
1134     fn GetPhrase(
1135         ppCoMemPhrase: *mut *mut SPPHRASE,
1136     ) -> HRESULT,
1137     fn GetSerializedPhrase(
1138         ppCoMemPhrase: *mut *mut SPSERIALIZEDPHRASE,
1139     ) -> HRESULT,
1140     fn GetText(
1141         ulStart: ULONG,
1142         ulCount: ULONG,
1143         fUseTextReplacements: BOOL,
1144         ppszCoMemText: *mut LPWSTR,
1145         pbDisplayAttributes: *mut BYTE,
1146     ) -> HRESULT,
1147     fn Discard(
1148         dwValueTypes: DWORD,
1149     ) -> HRESULT,
1150 });
1151 RIDL!(#[uuid(0x8fcebc98, 0x4e49, 0x4067, 0x9c, 0x6c, 0xd8, 0x6a, 0x0e, 0x09, 0x2e, 0x3d)]
1152 interface ISpPhraseAlt(ISpPhraseAltVtbl): ISpPhrase(ISpPhraseVtbl) {
1153     fn GetAltInfo(
1154         pParent: *mut *mut ISpPhrase,
1155         pulStartElementInParent: *mut ULONG,
1156         pcElementsInParent: *mut ULONG,
1157         pcElementsInAlt: *mut ULONG,
1158     ) -> HRESULT,
1159     fn Commit() -> HRESULT,
1160 });
1161 STRUCT!{struct SPRECORESULTTIMES {
1162     ftStreamTime: FILETIME,
1163     ullLength: ULONGLONG,
1164     dwTickCount: DWORD,
1165     ullStart: ULONGLONG,
1166 }}
1167 STRUCT!{struct SPSERIALIZEDRESULT {
1168     ulSerializedSize: ULONG,
1169 }}
1170 RIDL!(#[uuid(0x20b053be, 0xe235, 0x43cd, 0x9a, 0x2a, 0x8d, 0x17, 0xa4, 0x8b, 0x78, 0x42)]
1171 interface ISpRecoResult(ISpRecoResultVtbl): ISpPhrase(ISpPhraseVtbl) {
1172     fn GetResultTimes(
1173         pTimes: *mut SPRECORESULTTIMES,
1174     ) -> HRESULT,
1175     fn GetAlternates(
1176         ulStartElement: ULONG,
1177         cElements: ULONG,
1178         ulRequestCount: ULONG,
1179         ppPhrases: *mut *mut ISpPhraseAlt,
1180         pcPhrasesReturned: *mut ULONG,
1181     ) -> HRESULT,
1182     fn GetAudio(
1183         ulStartElement: ULONG,
1184         cElements: ULONG,
1185         ppStream: *mut *mut ISpStreamFormat,
1186     ) -> HRESULT,
1187     fn SpeakAudio(
1188         ulStartElement: ULONG,
1189         cElements: ULONG,
1190         dwFlags: DWORD,
1191         pulStreamNumber: *mut ULONG,
1192     ) -> HRESULT,
1193     fn Serialize(
1194         ppCoMemSerializedResult: *mut *mut SPSERIALIZEDRESULT,
1195     ) -> HRESULT,
1196     fn ScaleAudio(
1197         pAudioFormatId: *const GUID,
1198         pWaveFormatEx: *const WAVEFORMATEX,
1199     ) -> HRESULT,
1200     fn GetRecoContext(
1201         ppRecoContext: *mut *mut ISpRecoContext,
1202     ) -> HRESULT,
1203 });
1204 STRUCT!{struct SPTEXTSELECTIONINFO {
1205     ulStartActiveOffset: ULONG,
1206     cchActiveChars: ULONG,
1207     ulStartSelection: ULONG,
1208     cchSelection: ULONG,
1209 }}
1210 ENUM!{enum SPWORDPRONOUNCEABLE {
1211     SPWP_UNKNOWN_WORD_UNPRONOUNCEABLE = 0,
1212     SPWP_UNKNOWN_WORD_PRONOUNCEABLE = 1,
1213     SPWP_KNOWN_WORD_PRONOUNCEABLE = 2,
1214 }}
1215 ENUM!{enum SPGRAMMARSTATE {
1216     SPGS_DISABLED = 0,
1217     SPGS_ENABLED = 1,
1218     SPGS_EXCLUSIVE = 3,
1219 }}
1220 ENUM!{enum SPCONTEXTSTATE {
1221     SPCS_DISABLED = 0,
1222     SPCS_ENABLED = 1,
1223 }}
1224 ENUM!{enum SPRULESTATE {
1225     SPRS_INACTIVE = 0,
1226     SPRS_ACTIVE = 1,
1227     SPRS_ACTIVE_WITH_AUTO_PAUSE = 3,
1228 }}
1229 pub const SP_STREAMPOS_ASAP: ULONGLONG = 0;
1230 pub const SP_STREAMPOS_REALTIME: ULONGLONG = -1i64 as u64;
1231 pub const SPRULETRANS_TEXTBUFFER: SPSTATEHANDLE = -1isize as SPSTATEHANDLE;
1232 pub const SPRULETRANS_WILDCARD: SPSTATEHANDLE = -2isize as SPSTATEHANDLE;
1233 pub const SPRULETRANS_DICTATION: SPSTATEHANDLE = -3isize as SPSTATEHANDLE;
1234 ENUM!{enum SPGRAMMARWORDTYPE {
1235     SPWT_DISPLAY,
1236     SPWT_LEXICAL,
1237     SPWT_PRONUNCIATION,
1238     SPWT_LEXICAL_NO_SPECIAL_CHARS,
1239 }}
1240 STRUCT!{struct SPPROPERTYINFO {
1241     pszName: LPCWSTR,
1242     ulId: ULONG,
1243     pszValue: LPCWSTR,
1244     vValue: VARIANT,
1245 }}
1246 ENUM!{enum SPCFGRULEATTRIBUTES {
1247     SPRAF_TopLevel = 1 << 0,
1248     SPRAF_Active = 1 << 1,
1249     SPRAF_Export = 1 << 2,
1250     SPRAF_Import = 1 << 3,
1251     SPRAF_Interpreter = 1 << 4,
1252     SPRAF_Dynamic = 1 << 5,
1253     SPRAF_AutoPause = 1 << 16,
1254 }}
1255 RIDL!(#[uuid(0x8137828f, 0x591a, 0x4a42, 0xbe, 0x58, 0x49, 0xea, 0x7e, 0xba, 0xac, 0x68)]
1256 interface ISpGrammarBuilder(ISpGrammarBuilderVtbl): IUnknown(IUnknownVtbl) {
1257     fn ResetGrammar(
1258         NewLanguage: WORD,
1259     ) -> HRESULT,
1260     fn GetRule(
1261         pszRuleName: LPCWSTR,
1262         dwRuleId: DWORD,
1263         dwAttributes: DWORD,
1264         fCreateIfNotExist: BOOL,
1265         phInitialState: *mut SPSTATEHANDLE,
1266     ) -> HRESULT,
1267     fn ClearRule(
1268         hState: SPSTATEHANDLE,
1269     ) -> HRESULT,
1270     fn CreateNewState(
1271         hState: SPSTATEHANDLE,
1272         phState: *mut SPSTATEHANDLE,
1273     ) -> HRESULT,
1274     fn AddWordTransition(
1275         hFromState: SPSTATEHANDLE,
1276         hToState: SPSTATEHANDLE,
1277         psz: LPCWSTR,
1278         pszSeparators: LPCWSTR,
1279         eWordType: SPGRAMMARWORDTYPE,
1280         Weight: c_float,
1281         pPropInfo: *const SPPROPERTYINFO,
1282     ) -> HRESULT,
1283     fn AddRuleTransition(
1284         hFromState: SPSTATEHANDLE,
1285         hToState: SPSTATEHANDLE,
1286         hRule: SPSTATEHANDLE,
1287         Weight: c_float,
1288         pPropInfo: *const SPPROPERTYINFO,
1289     ) -> HRESULT,
1290     fn AddResource(
1291         hRuleState: SPSTATEHANDLE,
1292         pszResourceName: LPCWSTR,
1293         pszResourceValue: LPCWSTR,
1294     ) -> HRESULT,
1295     fn Commit(
1296         dwReserved: DWORD,
1297     ) -> HRESULT,
1298 });
1299 ENUM!{enum SPLOADOPTIONS {
1300     SPLO_STATIC = 0,
1301     SPLO_DYNAMIC = 1,
1302 }}
1303 RIDL!(#[uuid(0x2177db29, 0x7f45, 0x47d0, 0x85, 0x54, 0x06, 0x7e, 0x91, 0xc8, 0x05, 0x02)]
1304 interface ISpRecoGrammar(ISpRecoGrammarVtbl): ISpGrammarBuilder(ISpGrammarBuilderVtbl) {
1305     fn GetGrammarId(
1306         pullGrammarId: *mut ULONGLONG,
1307     ) -> HRESULT,
1308     fn GetRecoContext(
1309         ppRecoCtxt: *mut *mut ISpRecoContext,
1310     ) -> HRESULT,
1311     fn LoadCmdFromFile(
1312         pszFileName: LPCWSTR,
1313         Options: SPLOADOPTIONS,
1314     ) -> HRESULT,
1315     fn LoadCmdFromObject(
1316         rcid: REFCLSID,
1317         pszGrammarName: LPCWSTR,
1318         Options: SPLOADOPTIONS,
1319     ) -> HRESULT,
1320     fn LoadCmdFromResource(
1321         hModule: HMODULE,
1322         pszResourceName: LPCWSTR,
1323         pszResourceType: LPCWSTR,
1324         wLanguage: WORD,
1325         Options: SPLOADOPTIONS,
1326     ) -> HRESULT,
1327     fn LoadCmdFromMemory(
1328         pGrammar: *const SPBINARYGRAMMAR,
1329         Options: SPLOADOPTIONS,
1330     ) -> HRESULT,
1331     fn LoadCmdFromProprietaryGrammar(
1332         rguidParam: REFGUID,
1333         pszStringParam: LPCWSTR,
1334         pvDataPrarm: *const c_void,
1335         cbDataSize: ULONG,
1336         Options: SPLOADOPTIONS,
1337     ) -> HRESULT,
1338     fn SetRuleState(
1339         pszName: LPCWSTR,
1340         pReserved: *mut c_void,
1341         NewState: SPRULESTATE,
1342     ) -> HRESULT,
1343     fn SetRuleIdState(
1344         ulRuleId: ULONG,
1345         NewState: SPRULESTATE,
1346     ) -> HRESULT,
1347     fn LoadDictation(
1348         pszTopicName: LPCWSTR,
1349         Options: SPLOADOPTIONS,
1350     ) -> HRESULT,
1351     fn UnloadDictation() -> HRESULT,
1352     fn SetDictationState(
1353         NewState: SPRULESTATE,
1354     ) -> HRESULT,
1355     fn SetWordSequenceData(
1356         pText: *const WCHAR,
1357         cchText: ULONG,
1358         pInfo: *const SPTEXTSELECTIONINFO,
1359     ) -> HRESULT,
1360     fn SetTextSelection(
1361         pInfo: *const SPTEXTSELECTIONINFO,
1362     ) -> HRESULT,
1363     fn IsPronounceable(
1364         pszWord: LPCWSTR,
1365         pWordPronounceable: *mut SPWORDPRONOUNCEABLE,
1366     ) -> HRESULT,
1367     fn SetGrammarState(
1368         eGrammarState: SPGRAMMARSTATE,
1369     ) -> HRESULT,
1370     fn SaveCmd(
1371         pStream: *mut IStream,
1372         ppszCoMemErrorText: *mut LPWSTR,
1373     ) -> HRESULT,
1374     fn GetGrammarState(
1375         peGrammarState: *mut SPGRAMMARSTATE,
1376     ) -> HRESULT,
1377 });
1378 STRUCT!{struct SPRECOCONTEXTSTATUS {
1379     eInterference: SPINTERFERENCE,
1380     szRequestTypeOfUI: [WCHAR; 255],
1381     dwReserved1: DWORD,
1382     dwReserved2: DWORD,
1383 }}
1384 ENUM!{enum SPBOOKMARKOPTIONS {
1385     SPBO_NONE = 0,
1386     SPBO_PAUSE = 1 << 0,
1387 }}
1388 ENUM!{enum SPAUDIOOPTIONS {
1389     SPAO_NONE = 0,
1390     SPAO_RETAIN_AUDIO = 1 << 0,
1391 }}
1392 RIDL!(#[uuid(0xf740a62f, 0x7c15, 0x489e, 0x82, 0x34, 0x94, 0x0a, 0x33, 0xd9, 0x27, 0x2d)]
1393 interface ISpRecoContext(ISpRecoContextVtbl): ISpEventSource(ISpEventSourceVtbl) {
1394     fn GetRecognizer(
1395         ppRecognizer: *mut *mut ISpRecognizer,
1396     ) -> HRESULT,
1397     fn CreateGrammer(
1398         ullGrammarId: ULONGLONG,
1399         ppGrammar: *mut *mut ISpRecoGrammar,
1400     ) -> HRESULT,
1401     fn GetStatus(
1402         pState: *mut SPRECOCONTEXTSTATUS,
1403     ) -> HRESULT,
1404     fn GetMaxAlternates(
1405         pcAlternates: *mut ULONG,
1406     ) -> HRESULT,
1407     fn SetMaxAlternates(
1408         cAlternates: ULONG,
1409     ) -> HRESULT,
1410     fn SetAudioOptions(
1411         Options: SPAUDIOOPTIONS,
1412         pAudioFormatId: *const GUID,
1413         pWaveFormatEx: *const WAVEFORMATEX,
1414     ) -> HRESULT,
1415     fn GetAudioOptions(
1416         pOptions: *mut SPAUDIOOPTIONS,
1417         pAudioFormatId: *mut GUID,
1418         ppCoMemWFEX: *mut *mut WAVEFORMATEX,
1419     ) -> HRESULT,
1420     fn DeserializeResult(
1421         pSerializedResult: *const SPSERIALIZEDRESULT,
1422         ppResult: *mut *mut ISpRecoResult,
1423     ) -> HRESULT,
1424     fn Bookmark(
1425         Options: SPBOOKMARKOPTIONS,
1426         ullStreamPosition: ULONGLONG,
1427         lparamEvent: LPARAM,
1428     ) -> HRESULT,
1429     fn SetAdaptionData(
1430         pAdaptionData: LPCWSTR,
1431         cch: ULONG,
1432     ) -> HRESULT,
1433     fn Pause(
1434         dwReserved: DWORD,
1435     ) -> HRESULT,
1436     fn Resume(
1437         dwReserved: DWORD,
1438     ) -> HRESULT,
1439     fn SetVoice(
1440         pVoice: *mut ISpVoice,
1441         fAllowFormatChanges: BOOL,
1442     ) -> HRESULT,
1443     fn GetVoice(
1444         ppVoice: *mut *mut ISpVoice,
1445     ) -> HRESULT,
1446     fn SetVoicePurgeEvent(
1447         ullEventIntereset: ULONGLONG,
1448     ) -> HRESULT,
1449     fn GetVoicePurgeEvent(
1450         pullEventIntereset: *mut ULONGLONG,
1451     ) -> HRESULT,
1452     fn SetContextState(
1453         eContextState: SPCONTEXTSTATE,
1454     ) -> HRESULT,
1455     fn GetContextState(
1456         peContextState: *mut SPCONTEXTSTATE,
1457     ) -> HRESULT,
1458 });
1459 RIDL!(#[uuid(0x5b4fb971, 0xb115, 0x4de1, 0xad, 0x97, 0xe4, 0x82, 0xe3, 0xbf, 0x6e, 0xe4)]
1460 interface ISpProperties(ISpPropertiesVtbl): IUnknown(IUnknownVtbl) {
1461     fn SetPropertyNum(
1462         pName: LPCWSTR,
1463         lValue: LONG,
1464     ) -> HRESULT,
1465     fn GetPropertyNum(
1466         pName: LPCWSTR,
1467         plValue: *mut LONG,
1468     ) -> HRESULT,
1469     fn SetPropertyString(
1470         pName: LPCWSTR,
1471         pValue: LPCWSTR,
1472     ) -> HRESULT,
1473     fn GetPropertyString(
1474         pName: LPCWSTR,
1475         ppCoMemValue: *mut LPWSTR,
1476     ) -> HRESULT,
1477 });
1478 pub const SP_MAX_LANGIDS: usize = 20;
1479 STRUCT!{struct SPRECOGNIZERSTATUS {
1480     AudioStatus: SPAUDIOSTATUS,
1481     ullRecognitionStreamPos: ULONGLONG,
1482     ulStreamNumber: ULONG,
1483     ulNumActive: ULONG,
1484     clsidEngine: CLSID,
1485     cLangIDs: ULONG,
1486     aLangID: [WORD; SP_MAX_LANGIDS],
1487     ullRecognitionStreamTime: ULONGLONG,
1488 }}
1489 ENUM!{enum SPWAVEFORMATTYPE {
1490     SPWF_INPUT,
1491     SPWF_SRENGINE,
1492 }}
1493 pub type SPSTREAMFORMATTYPE = SPWAVEFORMATTYPE;
1494 ENUM!{enum SPRECOSTATE {
1495     SPRST_INACTIVE,
1496     SPRST_ACTIVE,
1497     SPRST_ACTIVE_ALWAYS,
1498     SPRST_INACTIVE_WITH_PURGE,
1499     SPRST_NUM_STATES,
1500 }}
1501 RIDL!(#[uuid(0xc2b5f241, 0xdaa0, 0x4507, 0x9e, 0x16, 0x5a, 0x1e, 0xaa, 0x2b, 0x7a, 0x5c)]
1502 interface ISpRecognizer(ISpRecognizerVtbl): ISpProperties(ISpPropertiesVtbl) {
1503     fn SetRecognizer(
1504         pRecognizer: *mut ISpObjectToken,
1505     ) -> HRESULT,
1506     fn GetRecognizer(
1507         ppRecognizer: *mut *mut ISpObjectToken,
1508     ) -> HRESULT,
1509     fn SetInput(
1510         pUnkInput: *mut IUnknown,
1511         fAllowFormatChanges: BOOL,
1512     ) -> HRESULT,
1513     fn GetInputObjectToken(
1514         ppToken: *mut *mut ISpObjectToken,
1515     ) -> HRESULT,
1516     fn GetInputStream(
1517         ppStream: *mut *mut ISpStreamFormat,
1518     ) -> HRESULT,
1519     fn CreateRecoContext(
1520         ppNewCtxt: *mut *mut ISpRecoContext,
1521     ) -> HRESULT,
1522     fn GetRecoProfile(
1523         ppToken: *mut *mut ISpObjectToken,
1524     ) -> HRESULT,
1525     fn SetRecoProfile(
1526         pToken: *mut ISpObjectToken,
1527     ) -> HRESULT,
1528     fn IsSharedInstance() -> HRESULT,
1529     fn GetRecoState(
1530         pState: *mut SPRECOSTATE,
1531     ) -> HRESULT,
1532     fn SetRecoState(
1533         NewState: SPRECOSTATE,
1534     ) -> HRESULT,
1535     fn GetStatus(
1536         pStatus: *mut SPRECOGNIZERSTATUS,
1537     ) -> HRESULT,
1538     fn GetFormat(
1539         WaveFormatType: SPSTREAMFORMATTYPE,
1540         pFormatId: *mut GUID,
1541         ppCoMemWFEX: *mut WAVEFORMATEX,
1542     ) -> HRESULT,
1543     fn IsUISupported(
1544         pszTypeOfUI: LPCWSTR,
1545         pvExtraData: *mut c_void,
1546         cbExtraData: ULONG,
1547         pfSupported: *mut BOOL,
1548     ) -> HRESULT,
1549     fn DisplayUI(
1550         hwndParent: HWND,
1551         pszTitle: LPCWSTR,
1552         pszTypeOfUI: LPCWSTR,
1553         pvExtraData: *mut c_void,
1554         cbExtraData: ULONG,
1555     ) -> HRESULT,
1556     fn EmulateRecognition(
1557         pPhrase: *mut ISpPhrase,
1558     ) -> HRESULT,
1559 });
1560 pub type SpeechLanguageId = c_long;
1561 ENUM!{enum DISPID_SpeechDataKey {
1562     DISPID_SDKSetBinaryValue = 1,
1563     DISPID_SDKGetBinaryValue,
1564     DISPID_SDKSetStringValue,
1565     DISPID_SDKGetStringValue,
1566     DISPID_SDKSetLongValue,
1567     DISPID_SDKGetlongValue,
1568     DISPID_SDKOpenKey,
1569     DISPID_SDKCreateKey,
1570     DISPID_SDKDeleteKey,
1571     DISPID_SDKDeleteValue,
1572     DISPID_SDKEnumKeys,
1573     DISPID_SDKEnumValues,
1574 }}
1575 ENUM!{enum DISPID_SpeechObjectToken {
1576     DISPID_SOTId = 1,
1577     DISPID_SOTDataKey,
1578     DISPID_SOTCategory,
1579     DISPID_SOTGetDescription,
1580     DISPID_SOTSetId,
1581     DISPID_SOTGetAttribute,
1582     DISPID_SOTCreateInstance,
1583     DISPID_SOTRemove,
1584     DISPID_SOTGetStorageFileName,
1585     DISPID_SOTRemoveStorageFileName,
1586     DISPID_SOTIsUISupported,
1587     DISPID_SOTDisplayUI,
1588     DISPID_SOTMatchesAttributes,
1589 }}
1590 ENUM!{enum SpeechDataKeyLocation {
1591     SDKLDefaultLocation = SPDKL_DefaultLocation,
1592     SDKLCurrentUser = SPDKL_CurrentUser,
1593     SDKLLocalMachine = SPDKL_LocalMachine,
1594     SDKLCurrentConfig = SPDKL_CurrentConfig,
1595 }}
1596 ENUM!{enum SpeechTokenContext {
1597     STCInprocServer = CLSCTX_INPROC_SERVER,
1598     STCInprocHandler = CLSCTX_INPROC_HANDLER,
1599     STCLocalServer = CLSCTX_LOCAL_SERVER,
1600     STCRemoteServer = CLSCTX_REMOTE_SERVER,
1601     STCAll = CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER
1602         | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER,
1603 }}
1604 ENUM!{enum SpeechTokenShellFolder {
1605     STSF_AppData = 0x1a,
1606     STSF_LocalAppData = 0x1c,
1607     STSF_CommonAppData = 0x23,
1608     STSF_FlagCreate = 0x8000,
1609 }}
1610 ENUM!{enum DISPID_SpeechObjectTokens {
1611     DISPID_SOTsCount = 1,
1612     DISPID_SOTsItem = DISPID_VALUE as u32,
1613     DISPID_SOTs_NewEnum = DISPID_NEWENUM as u32,
1614 }}
1615 ENUM!{enum DISPID_SpeechObjectTokenCategory {
1616     DISPID_SOTCId = 1,
1617     DISPID_SOTCDefault,
1618     DISPID_SOTCSetId,
1619     DISPID_SOTCGetDataKey,
1620     DISPID_SOTCEnumerateTokens,
1621 }}
1622 ENUM!{enum SpeechAudioFormatType {
1623     SAFTDefault = -1i32 as u32,
1624     SAFTNoAssignedFormat = 0,
1625     SAFTText = 1,
1626     SAFTNonStandardFormat = 2,
1627     SAFTExtendedAudioFormat = 3,
1628     SAFT8kHz8BitMono = 4,
1629     SAFT8kHz8BitStereo = 5,
1630     SAFT8kHz16BitMono = 6,
1631     SAFT8kHz16BitStereo = 7,
1632     SAFT11kHz8BitMono = 8,
1633     SAFT11kHz8BitStereo = 9,
1634     SAFT11kHz16BitMono = 10,
1635     SAFT11kHz16BitStereo = 11,
1636     SAFT12kHz8BitMono = 12,
1637     SAFT12kHz8BitStereo = 13,
1638     SAFT12kHz16BitMono = 14,
1639     SAFT12kHz16BitStereo = 15,
1640     SAFT16kHz8BitMono = 16,
1641     SAFT16kHz8BitStereo = 17,
1642     SAFT16kHz16BitMono = 18,
1643     SAFT16kHz16BitStereo = 19,
1644     SAFT22kHz8BitMono = 20,
1645     SAFT22kHz8BitStereo = 21,
1646     SAFT22kHz16BitMono = 22,
1647     SAFT22kHz16BitStereo = 23,
1648     SAFT24kHz8BitMono = 24,
1649     SAFT24kHz8BitStereo = 25,
1650     SAFT24kHz16BitMono = 26,
1651     SAFT24kHz16BitStereo = 27,
1652     SAFT32kHz8BitMono = 28,
1653     SAFT32kHz8BitStereo = 29,
1654     SAFT32kHz16BitMono = 30,
1655     SAFT32kHz16BitStereo = 31,
1656     SAFT44kHz8BitMono = 32,
1657     SAFT44kHz8BitStereo = 33,
1658     SAFT44kHz16BitMono = 34,
1659     SAFT44kHz16BitStereo = 35,
1660     SAFT48kHz8BitMono = 36,
1661     SAFT48kHz8BitStereo = 37,
1662     SAFT48kHz16BitMono = 38,
1663     SAFT48kHz16BitStereo = 39,
1664     SAFTTrueSpeech_8kHz1BitMono = 40,
1665     SAFTCCITT_ALaw_8kHzMono = 41,
1666     SAFTCCITT_ALaw_8kHzStereo = 42,
1667     SAFTCCITT_ALaw_11kHzMono = 43,
1668     SAFTCCITT_ALaw_11kHzStereo = 44,
1669     SAFTCCITT_ALaw_22kHzMono = 45,
1670     SAFTCCITT_ALaw_22kHzStereo = 46,
1671     SAFTCCITT_ALaw_44kHzMono = 47,
1672     SAFTCCITT_ALaw_44kHzStereo = 48,
1673     SAFTCCITT_uLaw_8kHzMono = 49,
1674     SAFTCCITT_uLaw_8kHzStereo = 50,
1675     SAFTCCITT_uLaw_11kHzMono = 51,
1676     SAFTCCITT_uLaw_11kHzStereo = 52,
1677     SAFTCCITT_uLaw_22kHzMono = 53,
1678     SAFTCCITT_uLaw_22kHzStereo = 54,
1679     SAFTCCITT_uLaw_44kHzMono = 55,
1680     SAFTCCITT_uLaw_44kHzStereo = 56,
1681     SAFTADPCM_8kHzMono = 57,
1682     SAFTADPCM_8kHzStereo = 58,
1683     SAFTADPCM_11kHzMono = 59,
1684     SAFTADPCM_11kHzStereo = 60,
1685     SAFTADPCM_22kHzMono = 61,
1686     SAFTADPCM_22kHzStereo = 62,
1687     SAFTADPCM_44kHzMono = 63,
1688     SAFTADPCM_44kHzStereo = 64,
1689     SAFTGSM610_8kHzMono = 65,
1690     SAFTGSM610_11kHzMono = 66,
1691     SAFTGSM610_22kHzMono = 67,
1692     SAFTGSM610_44kHzMono = 68,
1693 }}
1694 ENUM!{enum DISPID_SpeechAudioFormat {
1695     DISPID_SAFType = 1,
1696     DISPID_SAFGuid,
1697     DISPID_SAFGetWaveFormatEx,
1698     DISPID_SAFSetWaveFormatEx,
1699 }}
1700 ENUM!{enum DISPID_SpeechBaseStream {
1701     DISPID_SBSFormat = 1,
1702     DISPID_SBSRead,
1703     DISPID_SBSWrite,
1704     DISPID_SBSSeek,
1705 }}
1706 ENUM!{enum SpeechStreamSeekPositionType {
1707     SSSPTRelativeToStart = STREAM_SEEK_SET,
1708     SSSPTRelativeToCurrentPosition = STREAM_SEEK_CUR,
1709     SSSPTRelativeToEnd = STREAM_SEEK_END,
1710 }}
1711 ENUM!{enum DISPID_SpeechAudio {
1712     DISPID_SAStatus = 200,
1713     DISPID_SABufferInfo,
1714     DISPID_SADefaultFormat,
1715     DISPID_SAVolume,
1716     DISPID_SABufferNotifySize,
1717     DISPID_SAEventHandle,
1718     DISPID_SASetState,
1719 }}
1720 ENUM!{enum SpeechAudioState {
1721     SASClosed = SPAS_CLOSED,
1722     SASStop = SPAS_STOP,
1723     SASPause = SPAS_PAUSE,
1724     SASRun = SPAS_RUN,
1725 }}
1726 ENUM!{enum DISPID_SpeechMMSysAudio {
1727     DISPID_SMSADeviceId = 300,
1728     DISPID_SMSALineId,
1729     DISPID_SMSAMMHandle,
1730 }}
1731 ENUM!{enum DISPID_SpeechFileStream {
1732     DISPID_SFSOpen = 100,
1733     DISPID_SFSClose,
1734 }}
1735 ENUM!{enum SpeechStreamFileMode {
1736     SSFMOpenForRead = SPFM_OPEN_READONLY,
1737     SSFMOpenReadWrite = SPFM_OPEN_READWRITE,
1738     SSFMCreate = SPFM_CREATE,
1739     SSFMCreateForWrite = SPFM_CREATE_ALWAYS,
1740 }}
1741 ENUM!{enum DISPID_SpeechCustomStream {
1742     DISPID_SCSBaseStream = 100,
1743 }}
1744 ENUM!{enum DISPID_SpeechMemoryStream {
1745     DISPID_SMSSetData = 100,
1746     DISPID_SMSGetData,
1747 }}
1748 ENUM!{enum DISPID_SpeechAudioStatus {
1749     DISPID_SASFreeBufferSpace = 1,
1750     DISPID_SASNonBlockingIO,
1751     DISPID_SASState,
1752     DISPID_SASCurrentSeekPosition,
1753     DISPID_SASCurrentDevicePosition,
1754 }}
1755 ENUM!{enum DISPID_SpeechAudioBufferInfo {
1756     DISPID_SABIMinNotification = 1,
1757     DISPID_SABIBufferSize,
1758     DISPID_SABIEventBias,
1759 }}
1760 ENUM!{enum DISPID_SpeechWaveFormatEx {
1761     DISPID_SWFEFormatTag = 1,
1762     DISPID_SWFEChannels,
1763     DISPID_SWFESamplesPerSec,
1764     DISPID_SWFEAvgBytesPerSec,
1765     DISPID_SWFEBlockAlign,
1766     DISPID_SWFEBitsPerSample,
1767     DISPID_SWFEExtraData,
1768 }}
1769 ENUM!{enum DISPID_SpeechVoice {
1770     DISPID_SVStatus = 1,
1771     DISPID_SVVoice,
1772     DISPID_SVAudioOutput,
1773     DISPID_SVAudioOutputStream,
1774     DISPID_SVRate,
1775     DISPID_SVVolume,
1776     DISPID_SVAllowAudioOuputFormatChangesOnNextSet,
1777     DISPID_SVEventInterests,
1778     DISPID_SVPriority,
1779     DISPID_SVAlertBoundary,
1780     DISPID_SVSyncronousSpeakTimeout,
1781     DISPID_SVSpeak,
1782     DISPID_SVSpeakStream,
1783     DISPID_SVPause,
1784     DISPID_SVResume,
1785     DISPID_SVSkip,
1786     DISPID_SVGetVoices,
1787     DISPID_SVGetAudioOutputs,
1788     DISPID_SVWaitUntilDone,
1789     DISPID_SVSpeakCompleteEvent,
1790     DISPID_SVIsUISupported,
1791     DISPID_SVDisplayUI,
1792 }}
1793 ENUM!{enum SpeechVoicePriority {
1794     SVPNormal = SPVPRI_NORMAL,
1795     SVPAlert = SPVPRI_ALERT,
1796     SVPOver = SPVPRI_OVER,
1797 }}
1798 ENUM!{enum SpeechVoiceSpeakFlags {
1799     SVSFDefault = SPF_DEFAULT,
1800     SVSFlagsAsync = SPF_ASYNC,
1801     SVSFPurgeBeforeSpeak = SPF_PURGEBEFORESPEAK,
1802     SVSFIsFilename = SPF_IS_FILENAME,
1803     SVSFIsXML = SPF_IS_XML,
1804     SVSFIsNotXML = SPF_IS_NOT_XML,
1805     SVSFPersistXML = SPF_PERSIST_XML,
1806     SVSFNLPSpeakPunc = SPF_NLP_SPEAK_PUNC,
1807     SVSFNLPMask = SPF_NLP_MASK,
1808     SVSFVoiceMask = SPF_VOICE_MASK as u32,
1809     SVSFUnusedFlags = SPF_UNUSED_FLAGS as u32,
1810 }}
1811 ENUM!{enum SpeechVoiceEvents {
1812     SVEStartInputStream = 1 << 1,
1813     SVEEndInputStream = 1 << 2,
1814     SVEVoiceChange = 1 << 3,
1815     SVEBookmark = 1 << 4,
1816     SVEWordBoundary = 1 << 5,
1817     SVEPhoneme = 1 << 6,
1818     SVESentenceBoundary = 1 << 7,
1819     SVEViseme = 1 << 8,
1820     SVEAudioLevel = 1 << 9,
1821     SVEPrivate = 1 << 15,
1822     SVEAllEvents = 0x83fe,
1823 }}
1824 ENUM!{enum DISPID_SpeechVoiceStatus {
1825     DISPID_SVSCurrentStreamNumber = 1,
1826     DISPID_SVSLastStreamNumberQueued,
1827     DISPID_SVSLastResult,
1828     DISPID_SVSRunningState,
1829     DISPID_SVSInputWordPosition,
1830     DISPID_SVSInputWordLength,
1831     DISPID_SVSInputSentencePosition,
1832     DISPID_SVSInputSentenceLength,
1833     DISPID_SVSLastBookmark,
1834     DISPID_SVSLastBookmarkId,
1835     DISPID_SVSPhonemeId,
1836     DISPID_SVSVisemeId,
1837 }}
1838 ENUM!{enum SpeechRunState {
1839     SRSEDone = SPRS_DONE,
1840     SRSEIsSpeaking = SPRS_IS_SPEAKING,
1841 }}
1842 ENUM!{enum SpeechVisemeType {
1843     SVP_0 = 0,
1844     SVP_1,
1845     SVP_2,
1846     SVP_3,
1847     SVP_4,
1848     SVP_5,
1849     SVP_6,
1850     SVP_7,
1851     SVP_8,
1852     SVP_9,
1853     SVP_10,
1854     SVP_11,
1855     SVP_12,
1856     SVP_13,
1857     SVP_14,
1858     SVP_15,
1859     SVP_16,
1860     SVP_17,
1861     SVP_18,
1862     SVP_19,
1863     SVP_20,
1864     SVP_21,
1865 }}
1866 ENUM!{enum SpeechVisemeFeature {
1867     SVF_None = 0,
1868     SVF_Stressed = SPVFEATURE_STRESSED,
1869     SVF_Emphasis = SPVFEATURE_EMPHASIS,
1870 }}
1871 ENUM!{enum DISPID_SpeechVoiceEvent {
1872     DISPID_SVEStreamStart = 1,
1873     DISPID_SVEStreamEnd,
1874     DISPID_SVEVoiceChange,
1875     DISPID_SVEBookmark,
1876     DISPID_SVEWord,
1877     DISPID_SVEPhoneme,
1878     DISPID_SVESentenceBoundary,
1879     DISPID_SVEViseme,
1880     DISPID_SVEAudioLevel,
1881     DISPID_SVEEnginePrivate,
1882 }}
1883 ENUM!{enum DISPID_SpeechRecognizer {
1884     DISPID_SRRecognizer = 1,
1885     DISPID_SRAllowAudioInputFormatChangesOnNextSet,
1886     DISPID_SRAudioInput,
1887     DISPID_SRAudioInputStream,
1888     DISPID_SRIsShared,
1889     DISPID_SRState,
1890     DISPID_SRStatus,
1891     DISPID_SRProfile,
1892     DISPID_SREmulateRecognition,
1893     DISPID_SRCreateRecoContext,
1894     DISPID_SRGetFormat,
1895     DISPID_SRSetPropertyNumber,
1896     DISPID_SRGetPropertyNumber,
1897     DISPID_SRSetPropertyString,
1898     DISPID_SRGetPropertyString,
1899     DISPID_SRIsUISupported,
1900     DISPID_SRDisplayUI,
1901     DISPID_SRGetRecognizers,
1902     DISPID_SVGetAudioInputs,
1903     DISPID_SVGetProfiles,
1904 }}
1905 ENUM!{enum SpeechRecognizerState {
1906     SRSInactive = SPRST_INACTIVE,
1907     SRSActive = SPRST_ACTIVE,
1908     SRSActiveAlways = SPRST_ACTIVE_ALWAYS,
1909     SRSInactiveWithPurge = SPRST_INACTIVE_WITH_PURGE,
1910 }}
1911 ENUM!{enum SpeechDisplayAttributes {
1912     SDA_No_Trailing_Space = 0,
1913     SDA_One_Trailing_Space = SPAF_ONE_TRAILING_SPACE,
1914     SDA_Two_Trailing_Spaces = SPAF_TWO_TRAILING_SPACES,
1915     SDA_Consume_Leading_Spaces = SPAF_CONSUME_LEADING_SPACES,
1916 }}
1917 ENUM!{enum SpeechFormatType {
1918     SFTInput = SPWF_INPUT,
1919     SFTSREngine = SPWF_SRENGINE,
1920 }}
1921 ENUM!{enum DISPID_SpeechRecognizerStatus {
1922     DISPID_SRSAudioStatus = 1,
1923     DISPID_SRSCurrentStreamPosition,
1924     DISPID_SRSCurrentStreamNumber,
1925     DISPID_SRSNumberOfActiveRules,
1926     DISPID_SRSClsidEngine,
1927     DISPID_SRSSupportedLanguages,
1928 }}
1929 ENUM!{enum DISPID_SpeechRecoContext {
1930     DISPID_SRCRecognizer = 1,
1931     DISPID_SRCAudioInInterferenceStatus,
1932     DISPID_SRCRequestedUIType,
1933     DISPID_SRCVoice,
1934     DISPID_SRAllowVoiceFormatMatchingOnNextSet,
1935     DISPID_SRCVoicePurgeEvent,
1936     DISPID_SRCEventInterests,
1937     DISPID_SRCCmdMaxAlternates,
1938     DISPID_SRCState,
1939     DISPID_SRCRetainedAudio,
1940     DISPID_SRCRetainedAudioFormat,
1941     DISPID_SRCPause,
1942     DISPID_SRCResume,
1943     DISPID_SRCCreateGrammar,
1944     DISPID_SRCCreateResultFromMemory,
1945     DISPID_SRCBookmark,
1946     DISPID_SRCSetAdaptationData,
1947 }}
1948 ENUM!{enum SpeechRetainedAudioOptions {
1949     SRAONone = SPAO_NONE,
1950     SRAORetainAudio = SPAO_RETAIN_AUDIO,
1951 }}
1952 ENUM!{enum SpeechBookmarkOptions {
1953     SBONone = SPBO_NONE,
1954     SBOPause = SPBO_PAUSE,
1955 }}
1956 ENUM!{enum SpeechInterference {
1957     SINone = SPINTERFERENCE_NONE,
1958     SINoise = SPINTERFERENCE_NOISE,
1959     SINoSignal = SPINTERFERENCE_NOSIGNAL,
1960     SITooLoud = SPINTERFERENCE_TOOLOUD,
1961     SITooQuiet = SPINTERFERENCE_TOOQUIET,
1962     SITooFast = SPINTERFERENCE_TOOFAST,
1963     SITooSlow = SPINTERFERENCE_TOOSLOW,
1964 }}
1965 ENUM!{enum SpeechRecoEvents {
1966     SREStreamEnd = 1 << 0,
1967     SRESoundStart = 1 << 1,
1968     SRESoundEnd = 1 << 2,
1969     SREPhraseStart = 1 << 3,
1970     SRERecognition = 1 << 4,
1971     SREHypothesis = 1 << 5,
1972     SREBookmark = 1 << 6,
1973     SREPropertyNumChange = 1 << 7,
1974     SREPropertyStringChange = 1 << 8,
1975     SREFalseRecognition = 1 << 9,
1976     SREInterference = 1 << 10,
1977     SRERequestUI = 1 << 11,
1978     SREStateChange = 1 << 12,
1979     SREAdaptation = 1 << 13,
1980     SREStreamStart = 1 << 14,
1981     SRERecoOtherContext = 1 << 15,
1982     SREAudioLevel = 1 << 16,
1983     SREPrivate = 1 << 18,
1984     SREAllEvents = 0x5ffff,
1985 }}
1986 ENUM!{enum SpeechRecoContextState {
1987     SRCS_Disabled = SPCS_DISABLED,
1988     SRCS_Enabled = SPCS_ENABLED,
1989 }}
1990 ENUM!{enum DISPIDSPRG {
1991     DISPID_SRGId = 1,
1992     DISPID_SRGRecoContext,
1993     DISPID_SRGState,
1994     DISPID_SRGRules,
1995     DISPID_SRGReset,
1996     DISPID_SRGCommit,
1997     DISPID_SRGCmdLoadFromFile,
1998     DISPID_SRGCmdLoadFromObject,
1999     DISPID_SRGCmdLoadFromResource,
2000     DISPID_SRGCmdLoadFromMemory,
2001     DISPID_SRGCmdLoadFromProprietaryGrammar,
2002     DISPID_SRGCmdSetRuleState,
2003     DISPID_SRGCmdSetRuleIdState,
2004     DISPID_SRGDictationLoad,
2005     DISPID_SRGDictationUnload,
2006     DISPID_SRGDictationSetState,
2007     DISPID_SRGSetWordSequenceData,
2008     DISPID_SRGSetTextSelection,
2009     DISPID_SRGIsPronounceable,
2010 }}
2011 ENUM!{enum SpeechLoadOption {
2012     SLOStatic = SPLO_STATIC,
2013     SLODynamic = SPLO_DYNAMIC,
2014 }}
2015 ENUM!{enum SpeechWordPronounceable {
2016     SWPUnknownWordUnpronounceable = SPWP_UNKNOWN_WORD_UNPRONOUNCEABLE,
2017     SWPUnknownWordPronounceable = SPWP_UNKNOWN_WORD_PRONOUNCEABLE,
2018     SWPKnownWordPronounceable = SPWP_KNOWN_WORD_PRONOUNCEABLE,
2019 }}
2020 ENUM!{enum SpeechGrammarState {
2021     SGSEnabled = SPGS_ENABLED,
2022     SGSDisabled = SPGS_DISABLED,
2023     SGSExclusive = SPGS_EXCLUSIVE,
2024 }}
2025 ENUM!{enum SpeechRuleState {
2026     SGDSInactive = SPRS_INACTIVE,
2027     SGDSActive = SPRS_ACTIVE,
2028     SGDSActiveWithAutoPause = SPRS_ACTIVE_WITH_AUTO_PAUSE,
2029 }}
2030 ENUM!{enum SpeechRuleAttributes {
2031     SRATopLevel = SPRAF_TopLevel,
2032     SRADefaultToActive = SPRAF_Active,
2033     SRAExport = SPRAF_Export,
2034     SRAImport = SPRAF_Import,
2035     SRAInterpreter = SPRAF_Interpreter,
2036     SRADynamic = SPRAF_Dynamic,
2037 }}
2038 ENUM!{enum SpeechGrammarWordType {
2039     SGDisplay = SPWT_DISPLAY,
2040     SGLexical = SPWT_LEXICAL,
2041     SGPronounciation = SPWT_PRONUNCIATION,
2042 }}
2043 ENUM!{enum DISPID_SpeechRecoContextEvents {
2044     DISPID_SRCEStartStream = 1,
2045     DISPID_SRCEEndStream,
2046     DISPID_SRCEBookmark,
2047     DISPID_SRCESoundStart,
2048     DISPID_SRCESoundEnd,
2049     DISPID_SRCEPhraseStart,
2050     DISPID_SRCERecognition,
2051     DISPID_SRCEHypothesis,
2052     DISPID_SRCEPropertyNumberChange,
2053     DISPID_SRCEPropertyStringChange,
2054     DISPID_SRCEFalseRecognition,
2055     DISPID_SRCEInterference,
2056     DISPID_SRCERequestUI,
2057     DISPID_SRCERecognizerStateChange,
2058     DISPID_SRCEAdaptation,
2059     DISPID_SRCERecognitionForOtherContext,
2060     DISPID_SRCEAudioLevel,
2061     DISPID_SRCEEnginePrivate,
2062 }}
2063 ENUM!{enum SpeechRecognitionType {
2064     SRTStandard = 0,
2065     SRTAutopause = SPREF_AutoPause,
2066     SRTEmulated = SPREF_Emulated,
2067 }}
2068 ENUM!{enum DISPID_SpeechGrammarRule {
2069     DISPID_SGRAttributes = 1,
2070     DISPID_SGRInitialState,
2071     DISPID_SGRName,
2072     DISPID_SGRId,
2073     DISPID_SGRClear,
2074     DISPID_SGRAddResource,
2075     DISPID_SGRAddState,
2076 }}
2077 ENUM!{enum DISPID_SpeechGrammarRules {
2078     DISPID_SGRsCount = 1,
2079     DISPID_SGRsDynamic,
2080     DISPID_SGRsAdd,
2081     DISPID_SGRsCommit,
2082     DISPID_SGRsCommitAndSave,
2083     DISPID_SGRsFindRule,
2084     DISPID_SGRsItem = DISPID_VALUE as u32,
2085     DISPID_SGRs_NewEnum = DISPID_NEWENUM as u32,
2086 }}
2087 ENUM!{enum DISPID_SpeechGrammarRuleState {
2088     DISPID_SGRSRule = 1,
2089     DISPID_SGRSTransitions,
2090     DISPID_SGRSAddWordTransition,
2091     DISPID_SGRSAddRuleTransition,
2092     DISPID_SGRSAddSpecialTransition,
2093 }}
2094 ENUM!{enum SpeechSpecialTransitionType {
2095     SSTTWildcard = 1,
2096     SSTTDictation,
2097     SSTTTextBuffer,
2098 }}
2099 ENUM!{enum DISPID_SpeechGrammarRuleStateTransitions {
2100     DISPID_SGRSTsCount = 1,
2101     DISPID_SGRSTsItem = DISPID_VALUE as u32,
2102     DISPID_SGRSTs_NewEnum = DISPID_NEWENUM as u32,
2103 }}
2104 ENUM!{enum DISPID_SpeechGrammarRuleStateTransition {
2105     DISPID_SGRSTType = 1,
2106     DISPID_SGRSTText,
2107     DISPID_SGRSTRule,
2108     DISPID_SGRSTWeight,
2109     DISPID_SGRSTPropertyName,
2110     DISPID_SGRSTPropertyId,
2111     DISPID_SGRSTPropertyValue,
2112     DISPID_SGRSTNextState,
2113 }}
2114 ENUM!{enum SpeechGrammarRuleStateTransitionType {
2115     SGRSTTEpsilon = 0,
2116     SGRSTTWord,
2117     SGRSTTRule,
2118     SGRSTTDictation,
2119     SGRSTTWildcard,
2120     SGRSTTTextBuffer,
2121 }}
2122 ENUM!{enum DISPIDSPTSI {
2123     DISPIDSPTSI_ActiveOffset = 1,
2124     DISPIDSPTSI_ActiveLength,
2125     DISPIDSPTSI_SelectionOffset,
2126     DISPIDSPTSI_SelectionLength,
2127 }}
2128 ENUM!{enum DISPID_SpeechRecoResult {
2129     DISPID_SRRRecoContext = 1,
2130     DISPID_SRRTimes,
2131     DISPID_SRRAudioFormat,
2132     DISPID_SRRPhraseInfo,
2133     DISPID_SRRAlternates,
2134     DISPID_SRRAudio,
2135     DISPID_SRRSpeakAudio,
2136     DISPID_SRRSaveToMemory,
2137     DISPID_SRRDiscardResultInfo,
2138 }}
2139 ENUM!{enum SpeechDiscardType {
2140     SDTProperty = SPDF_PROPERTY,
2141     SDTReplacement = SPDF_REPLACEMENT,
2142     SDTRule = SPDF_RULE,
2143     SDTDisplayText = SPDF_DISPLAYTEXT,
2144     SDTLexicalForm = SPDF_LEXICALFORM,
2145     SDTPronunciation = SPDF_PRONUNCIATION,
2146     SDTAudio = SPDF_AUDIO,
2147     SDTAlternates = SPDF_ALTERNATES,
2148     SDTAll = SPDF_ALL,
2149 }}
2150 ENUM!{enum DISPID_SpeechPhraseBuilder {
2151     DISPID_SPPBRestorePhraseFromMemory = 1,
2152 }}
2153 ENUM!{enum DISPID_SpeechRecoResultTimes {
2154     DISPID_SRRTStreamTime = 1,
2155     DISPID_SRRTLength,
2156     DISPID_SRRTTickCount,
2157     DISPID_SRRTOffsetFromStart,
2158 }}
2159 ENUM!{enum DISPID_SpeechPhraseAlternate {
2160     DISPID_SPARecoResult = 1,
2161     DISPID_SPAStartElementInResult,
2162     DISPID_SPANumberOfElementsInResult,
2163     DISPID_SPAPhraseInfo,
2164     DISPID_SPACommit,
2165 }}
2166 ENUM!{enum DISPID_SpeechPhraseAlternates {
2167     DISPID_SPAsCount = 1,
2168     DISPID_SPAsItem = DISPID_VALUE as u32,
2169     DISPID_SPAs_NewEnum = DISPID_NEWENUM as u32,
2170 }}
2171 ENUM!{enum DISPID_SpeechPhraseInfo {
2172     DISPID_SPILanguageId = 1,
2173     DISPID_SPIGrammarId,
2174     DISPID_SPIStartTime,
2175     DISPID_SPIAudioStreamPosition,
2176     DISPID_SPIAudioSizeBytes,
2177     DISPID_SPIRetainedSizeBytes,
2178     DISPID_SPIAudioSizeTime,
2179     DISPID_SPIRule,
2180     DISPID_SPIProperties,
2181     DISPID_SPIElements,
2182     DISPID_SPIReplacements,
2183     DISPID_SPIEngineId,
2184     DISPID_SPIEnginePrivateData,
2185     DISPID_SPISaveToMemory,
2186     DISPID_SPIGetText,
2187     DISPID_SPIGetDisplayAttributes,
2188 }}
2189 ENUM!{enum DISPID_SpeechPhraseElement {
2190     DISPID_SPEAudioTimeOffset = 1,
2191     DISPID_SPEAudioSizeTime,
2192     DISPID_SPEAudioStreamOffset,
2193     DISPID_SPEAudioSizeBytes,
2194     DISPID_SPERetainedStreamOffset,
2195     DISPID_SPERetainedSizeBytes,
2196     DISPID_SPEDisplayText,
2197     DISPID_SPELexicalForm,
2198     DISPID_SPEPronunciation,
2199     DISPID_SPEDisplayAttributes,
2200     DISPID_SPERequiredConfidence,
2201     DISPID_SPEActualConfidence,
2202     DISPID_SPEEngineConfidence,
2203 }}
2204 ENUM!{enum SpeechEngineConfidence {
2205     SECLowConfidence = -1i32 as u32,
2206     SECNormalConfidence = 0,
2207     SECHighConfidence = 1,
2208 }}
2209 ENUM!{enum DISPID_SpeechPhraseElements {
2210     DISPID_SPEsCount = 1,
2211     DISPID_SPEsItem = DISPID_VALUE as u32,
2212     DISPID_SPEs_NewEnum = DISPID_NEWENUM as u32,
2213 }}
2214 ENUM!{enum DISPID_SpeechPhraseReplacement {
2215     DISPID_SPRDisplayAttributes = 1,
2216     DISPID_SPRText,
2217     DISPID_SPRFirstElement,
2218     DISPID_SPRNumberOfElements,
2219 }}
2220 ENUM!{enum DISPID_SpeechPhraseReplacements {
2221     DISPID_SPRsCount = 1,
2222     DISPID_SPRsItem = DISPID_VALUE as u32,
2223     DISPID_SPRs_NewEnum = DISPID_NEWENUM as u32,
2224 }}
2225 ENUM!{enum DISPID_SpeechPhraseProperty {
2226     DISPID_SPPName = 1,
2227     DISPID_SPPId,
2228     DISPID_SPPValue,
2229     DISPID_SPPFirstElement,
2230     DISPID_SPPNumberOfElements,
2231     DISPID_SPPEngineConfidence,
2232     DISPID_SPPConfidence,
2233     DISPID_SPPParent,
2234     DISPID_SPPChildren,
2235 }}
2236 ENUM!{enum DISPID_SpeechPhraseProperties {
2237     DISPID_SPPsCount = 1,
2238     DISPID_SPPsItem = DISPID_VALUE as u32,
2239     DISPID_SPPs_NewEnum = DISPID_NEWENUM as u32,
2240 }}
2241 ENUM!{enum DISPID_SpeechPhraseRule {
2242     DISPID_SPRuleName = 1,
2243     DISPID_SPRuleId,
2244     DISPID_SPRuleFirstElement,
2245     DISPID_SPRuleNumberOfElements,
2246     DISPID_SPRuleParent,
2247     DISPID_SPRuleChildren,
2248     DISPID_SPRuleConfidence,
2249     DISPID_SPRuleEngineConfidence,
2250 }}
2251 ENUM!{enum DISPID_SpeechPhraseRules {
2252     DISPID_SPRulesCount = 1,
2253     DISPID_SPRulesItem = DISPID_VALUE as u32,
2254     DISPID_SPRules_NewEnum = DISPID_NEWENUM as u32,
2255 }}
2256 ENUM!{enum DISPID_SpeechLexicon {
2257     DISPID_SLGenerationId = 1,
2258     DISPID_SLGetWords,
2259     DISPID_SLAddPronunciation,
2260     DISPID_SLAddPronunciationByPhoneIds,
2261     DISPID_SLRemovePronunciation,
2262     DISPID_SLRemovePronunciationByPhoneIds,
2263     DISPID_SLGetPronunciations,
2264     DISPID_SLGetGenerationChange,
2265 }}
2266 ENUM!{enum SpeechLexiconType {
2267     SLTUser = eLEXTYPE_USER,
2268     SLTApp = eLEXTYPE_APP,
2269 }}
2270 ENUM!{enum SpeechPartOfSpeech {
2271     SPSNotOverriden = SPPS_NotOverriden,
2272     SPSUnknown = SPPS_Unknown,
2273     SPSNoun = SPPS_Noun,
2274     SPSVerb = SPPS_Verb,
2275     SPSModifier = SPPS_Modifier,
2276     SPSFunction = SPPS_Function,
2277     SPSInterjection = SPPS_Interjection,
2278 }}
2279 ENUM!{enum DISPID_SpeechLexiconWords {
2280     DISPID_SLWsCount = 1,
2281     DISPID_SLWsItem = DISPID_VALUE as u32,
2282     DISPID_SLWs_NewEnum = DISPID_NEWENUM as u32,
2283 }}
2284 ENUM!{enum SpeechWordType {
2285     SWTAdded = eWORDTYPE_ADDED,
2286     SWTDeleted = eWORDTYPE_DELETED,
2287 }}
2288 ENUM!{enum DISPID_SpeechLexiconWord {
2289     DISPID_SLWLangId = 1,
2290     DISPID_SLWType,
2291     DISPID_SLWWord,
2292     DISPID_SLWPronunciations,
2293 }}
2294 ENUM!{enum DISPID_SpeechLexiconProns {
2295     DISPID_SLPsCount = 1,
2296     DISPID_SLPsItem = DISPID_VALUE as u32,
2297     DISPID_SLPs_NewEnum = DISPID_NEWENUM as u32,
2298 }}
2299 ENUM!{enum DISPID_SpeechLexiconPronunciation {
2300     DISPID_SLPType = 1,
2301     DISPID_SLPLangId,
2302     DISPID_SLPPartOfSpeech,
2303     DISPID_SLPPhoneIds,
2304     DISPID_SLPSymbolic,
2305 }}
2306 ENUM!{enum DISPID_SpeechPhoneConverter {
2307     DISPID_SPCLangId = 1,
2308     DISPID_SPCPhoneToId,
2309     DISPID_SPCIdToPhone,
2310 }}
2311 extern {
2312     pub static LIBID_SpeechLib: IID;
2313 }
2314 RIDL!(#[uuid(0xce17c09b, 0x4efa, 0x44d5, 0xa4, 0xc9, 0x59, 0xd9, 0x58, 0x5a, 0xb0, 0xcd)]
2315 interface ISpeechDataKey(ISpeechDataKeyVtbl): IDispatch(IDispatchVtbl) {
2316     fn SetBinaryValue(
2317         ValueName: BSTR,
2318         Value: VARIANT,
2319     ) -> HRESULT,
2320     fn GetBinaryValue(
2321         ValueName: BSTR,
2322         Value: *mut VARIANT,
2323     ) -> HRESULT,
2324     fn SetStringValue(
2325         ValueName: BSTR,
2326         Value: BSTR,
2327     ) -> HRESULT,
2328     fn GetStringValue(
2329         ValueName: BSTR,
2330         Value: *mut BSTR,
2331     ) -> HRESULT,
2332     fn SetLongValue(
2333         ValueName: BSTR,
2334         Value: c_long,
2335     ) -> HRESULT,
2336     fn GetLongValue(
2337         ValueName: BSTR,
2338         Value: *mut c_long,
2339     ) -> HRESULT,
2340     fn OpenKey(
2341         SubKeyName: BSTR,
2342         SubKey: *mut *mut ISpeechDataKey,
2343     ) -> HRESULT,
2344     fn CreateKey(
2345         SubKeyName: BSTR,
2346         SubKey: *mut *mut ISpeechDataKey,
2347     ) -> HRESULT,
2348     fn DeleteKey(
2349         SubKeyName: BSTR,
2350     ) -> HRESULT,
2351     fn DeleteValue(
2352         ValueName: BSTR,
2353     ) -> HRESULT,
2354     fn EnumKeys(
2355         Index: c_long,
2356         SubKeyName: *mut BSTR,
2357     ) -> HRESULT,
2358     fn EnumValues(
2359         Index: c_long,
2360         ValueName: *mut BSTR,
2361     ) -> HRESULT,
2362 });
2363 RIDL!(#[uuid(0xc74a3adc, 0xb727, 0x4500, 0xa8, 0x4a, 0xb5, 0x26, 0x72, 0x1c, 0x8b, 0x8c)]
2364 interface ISpeechObjectToken(ISpeechObjectTokenVtbl): IDispatch(IDispatchVtbl) {
2365     fn get_Id(
2366         ObjectId: *mut BSTR,
2367     ) -> HRESULT,
2368     fn get_DataKey(
2369         DataKey: *mut *mut ISpeechDataKey,
2370     ) -> HRESULT,
2371     fn get_Category(
2372         Category: *mut *mut ISpeechObjectTokenCategory,
2373     ) -> HRESULT,
2374     fn GetDescription(
2375         Locale: c_long,
2376         Description: *mut BSTR,
2377     ) -> HRESULT,
2378     fn SetId(
2379         Id: BSTR,
2380         CategoryId: BSTR,
2381         CreateIfNotExist: VARIANT_BOOL,
2382     ) -> HRESULT,
2383     fn GetAttribute(
2384         AttributeName: BSTR,
2385         AttributeValue: *mut BSTR,
2386     ) -> HRESULT,
2387     fn CreateInstance(
2388         pUnkOuter: *mut IUnknown,
2389         ClsContext: SpeechTokenContext,
2390         Object: *mut *mut IUnknown,
2391     ) -> HRESULT,
2392     fn Remove(
2393         ObjectStorageCLSID: BSTR,
2394     ) -> HRESULT,
2395     fn GetStorageFileName(
2396         ObjectStorageCLSID: BSTR,
2397         KeyName: BSTR,
2398         FileName: BSTR,
2399         Folder: BSTR,
2400         FilePath: *mut BSTR,
2401     ) -> HRESULT,
2402     fn RemoveStorageFileName(
2403         ObjectStorageCLSID: BSTR,
2404         KeyName: BSTR,
2405         DeleteFile: VARIANT_BOOL,
2406     ) -> HRESULT,
2407     fn IsUISupported(
2408         TypeOfUI: BSTR,
2409         ExtraData: *const VARIANT,
2410         Object: *mut IUnknown,
2411         Supported: *mut VARIANT_BOOL,
2412     ) -> HRESULT,
2413     fn DisplayUI(
2414         hWnd: c_long,
2415         Title: BSTR,
2416         TypeOfUI: BSTR,
2417         ExtraData: *const VARIANT,
2418         Object: *mut IUnknown,
2419     ) -> HRESULT,
2420     fn MatchesAttributes(
2421         Attributes: BSTR,
2422         Matches: *mut VARIANT_BOOL,
2423     ) -> HRESULT,
2424 });
2425 RIDL!(#[uuid(0x9285b776, 0x2e7b, 0x4bc0, 0xb5, 0x3e, 0x58, 0x0e, 0xb6, 0xfa, 0x96, 0x7f)]
2426 interface ISpeechObjectTokens(ISpeechObjectTokensVtbl): IDispatch(IDispatchVtbl) {
2427     fn get_Count(
2428         Count: *mut c_long,
2429     ) -> HRESULT,
2430     fn Item(
2431         Index: c_long,
2432         Token: *mut *mut ISpeechObjectToken,
2433     ) -> HRESULT,
2434     fn get__NewEnum(
2435         ppEnumVARIANT: *mut *mut IUnknown,
2436     ) -> HRESULT,
2437 });
2438 RIDL!(#[uuid(0xca7eac50, 0x2d01, 0x4145, 0x86, 0xd4, 0x5a, 0xe7, 0xd7, 0x0f, 0x44, 0x69)]
2439 interface ISpeechObjectTokenCategory(ISpeechObjectTokenCategoryVtbl): IDispatch(IDispatchVtbl) {
2440     fn get_Id(
2441         Id: *mut BSTR,
2442     ) -> HRESULT,
2443     fn put_Default(
2444         TokenId: BSTR,
2445     ) -> HRESULT,
2446     fn get_Default(
2447         TokenId: *mut BSTR,
2448     ) -> HRESULT,
2449     fn SetId(
2450         Id: BSTR,
2451         CreateIfNotExist: VARIANT_BOOL,
2452     ) -> HRESULT,
2453     fn GetDataKey(
2454         Location: SpeechDataKeyLocation,
2455         DataKey: *mut *mut ISpeechDataKey,
2456     ) -> HRESULT,
2457     fn EnumerateTokens(
2458         RequiredAttributes: BSTR,
2459         OptionalAttributes: BSTR,
2460         Tokens: *mut *mut ISpeechObjectTokens,
2461     ) -> HRESULT,
2462 });
2463 RIDL!(#[uuid(0x11b103d8, 0x1142, 0x4edf, 0xa0, 0x93, 0x82, 0xfb, 0x39, 0x15, 0xf8, 0xcc)]
2464 interface ISpeechAudioBufferInfo(ISpeechAudioBufferInfoVtbl): IDispatch(IDispatchVtbl) {
2465     fn get_MinNotification(
2466         MinNotification: *mut c_long,
2467     ) -> HRESULT,
2468     fn put_MinNotification(
2469         MinNotification: c_long,
2470     ) -> HRESULT,
2471     fn get_BufferSize(
2472         BufferSize: *mut c_long,
2473     ) -> HRESULT,
2474     fn put_BufferSize(
2475         BufferSize: c_long,
2476     ) -> HRESULT,
2477     fn get_EventBias(
2478         EventBias: *mut c_long,
2479     ) -> HRESULT,
2480     fn put_EventBias(
2481         EventBias: c_long,
2482     ) -> HRESULT,
2483 });
2484 RIDL!(#[uuid(0xc62d9c91, 0x7458, 0x47f6, 0x86, 0x2d, 0x1e, 0xf8, 0x6f, 0xb0, 0xb2, 0x78)]
2485 interface ISpeechAudioStatus(ISpeechAudioStatusVtbl): IDispatch(IDispatchVtbl) {
2486     fn get_FreeBufferSpace(
2487         FreeBufferSpace: *mut c_long,
2488     ) -> HRESULT,
2489     fn get_NonBlockingIO(
2490         NonBlockingIO: *mut c_long,
2491     ) -> HRESULT,
2492     fn get_State(
2493         State: *mut SpeechAudioState,
2494     ) -> HRESULT,
2495     fn get_CurrentSeekPosition(
2496         CurrentSeekPosition: *mut VARIANT,
2497     ) -> HRESULT,
2498     fn get_CurrentDevicePosition(
2499         CurrentDevicePosition: *mut VARIANT,
2500     ) -> HRESULT,
2501 });
2502 RIDL!(#[uuid(0xe6e9c590, 0x3e18, 0x40e3, 0x82, 0x99, 0x06, 0x1f, 0x98, 0xbd, 0xe7, 0xc7)]
2503 interface ISpeechAudioFormat(ISpeechAudioFormatVtbl): IDispatch(IDispatchVtbl) {
2504     fn get_Type(
2505         AudioFormat: *mut SpeechAudioFormatType,
2506     ) -> HRESULT,
2507     fn put_Type(
2508         AudioFormat: SpeechAudioFormatType,
2509     ) -> HRESULT,
2510     fn get_Guid(
2511         Guid: *mut BSTR,
2512     ) -> HRESULT,
2513     fn put_Guid(
2514         Guid: BSTR,
2515     ) -> HRESULT,
2516     fn GetWaveFormatEx(
2517         SpeechWaveFormatEx: *mut *mut ISpeechWaveFormatEx,
2518     ) -> HRESULT,
2519     fn SetWaveFormatEx(
2520         SpeechWaveFormatEx: *mut ISpeechWaveFormatEx,
2521     ) -> HRESULT,
2522 });
2523 RIDL!(#[uuid(0x7a1ef0d5, 0x1581, 0x4741, 0x88, 0xe4, 0x20, 0x9a, 0x49, 0xf1, 0x1a, 0x10)]
2524 interface ISpeechWaveFormatEx(ISpeechWaveFormatExVtbl): IDispatch(IDispatchVtbl) {
2525     fn get_FormatTag(
2526         FormatTag: *mut c_short,
2527     ) -> HRESULT,
2528     fn put_FormatTag(
2529         FormatTag: c_short,
2530     ) -> HRESULT,
2531     fn get_Channels(
2532         Channels: *mut c_short,
2533     ) -> HRESULT,
2534     fn put_Channels(
2535         Channels: c_short,
2536     ) -> HRESULT,
2537     fn get_SamplesPerSec(
2538         SamplesPerSec: *mut c_long,
2539     ) -> HRESULT,
2540     fn put_SamplesPerSec(
2541         SamplesPerSec: c_long,
2542     ) -> HRESULT,
2543     fn get_AvgBytesPerSec(
2544         AvgBytesPerSec: *mut c_long,
2545     ) -> HRESULT,
2546     fn put_AvgBytesPerSec(
2547         AvgBytesPerSec: c_long,
2548     ) -> HRESULT,
2549     fn get_BlockAlign(
2550         BlockAlign: *mut c_short,
2551     ) -> HRESULT,
2552     fn put_BlockAlign(
2553         BlockAlign: c_short,
2554     ) -> HRESULT,
2555     fn get_BitsPerSample(
2556         BitsPerSample: *mut c_short,
2557     ) -> HRESULT,
2558     fn put_BitsPerSample(
2559         BitsPerSample: c_short,
2560     ) -> HRESULT,
2561     fn get_ExtraData(
2562         ExtraData: *mut VARIANT,
2563     ) -> HRESULT,
2564     fn put_ExtraData(
2565         ExtraData: VARIANT,
2566     ) -> HRESULT,
2567 });
2568 RIDL!(#[uuid(0x6450336f, 0x7d49, 0x4ced, 0x80, 0x97, 0x49, 0xd6, 0xde, 0xe3, 0x72, 0x94)]
2569 interface ISpeechBaseStream(ISpeechBaseStreamVtbl): IDispatch(IDispatchVtbl) {
2570     fn get_Format(
2571         AudioFormat: *mut *mut ISpeechAudioFormat,
2572     ) -> HRESULT,
2573     fn putref_Format(
2574         AudioFormat: *mut ISpeechAudioFormat,
2575     ) -> HRESULT,
2576     fn Read(
2577         Buffer: *mut VARIANT,
2578         NumberOfBytes: c_long,
2579         BytesRead: *mut c_long,
2580     ) -> HRESULT,
2581     fn Write(
2582         Buffer: VARIANT,
2583         BytesWritten: *mut c_long,
2584     ) -> HRESULT,
2585     fn Seek(
2586         Position: VARIANT,
2587         Origin: SpeechStreamSeekPositionType,
2588         NewPosition: *mut VARIANT,
2589     ) -> HRESULT,
2590 });
2591 RIDL!(#[uuid(0xaf67f125, 0xab39, 0x4e93, 0xb4, 0xa2, 0xcc, 0x2e, 0x66, 0xe1, 0x82, 0xa7)]
2592 interface ISpeechFileStream(ISpeechFileStreamVtbl): ISpeechBaseStream(ISpeechBaseStreamVtbl) {
2593     fn Open(
2594         FileName: BSTR,
2595         FileMode: SpeechStreamFileMode,
2596         DoEvents: VARIANT_BOOL,
2597     ) -> HRESULT,
2598     fn Close() -> HRESULT,
2599 });
2600 RIDL!(#[uuid(0xeeb14b68, 0x808b, 0x4abe, 0xa5, 0xea, 0xb5, 0x1d, 0xa7, 0x58, 0x80, 0x08)]
2601 interface ISpeechMemoryStream(ISpeechMemoryStreamVtbl): ISpeechBaseStream(ISpeechBaseStreamVtbl) {
2602     fn SetData(
2603         Data: VARIANT,
2604     ) -> HRESULT,
2605     fn GetData(
2606         pData: *mut VARIANT,
2607     ) -> HRESULT,
2608 });
2609 RIDL!(#[uuid(0x1a9e9f4f, 0x104f, 0x4db8, 0xa1, 0x15, 0xef, 0xd7, 0xfd, 0x0c, 0x97, 0xae)]
2610 interface ISpeechCustomStream(ISpeechCustomStreamVtbl): ISpeechBaseStream(ISpeechBaseStreamVtbl) {
2611     fn get_BaseStream(
2612         ppUnkStream: *mut *mut IUnknown,
2613     ) -> HRESULT,
2614     fn putref_BaseStream(
2615         pUnkStream: *mut IUnknown,
2616     ) -> HRESULT,
2617 });
2618 RIDL!(#[uuid(0xcff8e175, 0x019e, 0x11d3, 0xa0, 0x8e, 0x00, 0xc0, 0x4f, 0x8e, 0xf9, 0xb5)]
2619 interface ISpeechAudio(ISpeechAudioVtbl): ISpeechBaseStream(ISpeechBaseStreamVtbl) {
2620     fn get_Status(
2621         Status: *mut *mut ISpeechAudioStatus,
2622     ) -> HRESULT,
2623     fn get_BufferInfo(
2624         BufferInfo: *mut *mut ISpeechAudioBufferInfo,
2625     ) -> HRESULT,
2626     fn get_DefaultFormat(
2627         StreamFormat: *mut *mut ISpeechAudioFormat,
2628     ) -> HRESULT,
2629     fn get_Volume(
2630         Volume: *mut c_long,
2631     ) -> HRESULT,
2632     fn put_Volume(
2633         Volume: c_long,
2634     ) -> HRESULT,
2635     fn get_BufferNotifySize(
2636         BufferNotifySize: *mut c_long,
2637     ) -> HRESULT,
2638     fn put_BufferNotifySize(
2639         BufferNotifySize: c_long,
2640     ) -> HRESULT,
2641     fn get_EventHandle(
2642         EventHandle: *mut c_long,
2643     ) -> HRESULT,
2644     fn SetState(
2645         State: SpeechAudioState,
2646     ) -> HRESULT,
2647 });
2648 RIDL!(#[uuid(0x3c76af6d, 0x1fd7, 0x4831, 0x81, 0xd1, 0x3b, 0x71, 0xd5, 0xa1, 0x3c, 0x44)]
2649 interface ISpeechMMSysAudio(ISpeechMMSysAudioVtbl): ISpeechAudio(ISpeechAudioVtbl) {
2650     fn get_DeviceId(
2651         DeviceId: *mut c_long,
2652     ) -> HRESULT,
2653     fn put_DeviceId(
2654         DeviceId: c_long,
2655     ) -> HRESULT,
2656     fn get_LineId(
2657         LineId: *mut c_long,
2658     ) -> HRESULT,
2659     fn put_LineId(
2660         LineId: c_long,
2661     ) -> HRESULT,
2662     fn get_MMHandle(
2663         Handle: *mut c_long,
2664     ) -> HRESULT,
2665 });
2666 RIDL!(#[uuid(0x269316d8, 0x57bd, 0x11d2, 0x9e, 0xee, 0x00, 0xc0, 0x4f, 0x79, 0x73, 0x96)]
2667 interface ISpeechVoice(ISpeechVoiceVtbl): IDispatch(IDispatchVtbl) {
2668     fn get_Status(
2669         Status: *mut *mut ISpeechVoiceStatus,
2670     ) -> HRESULT,
2671     fn get_Voice(
2672         Voice: *mut *mut ISpeechObjectToken,
2673     ) -> HRESULT,
2674     fn putref_Voice(
2675         Voice: *mut ISpeechObjectToken,
2676     ) -> HRESULT,
2677     fn get_AudioOutput(
2678         AudioOutput: *mut *mut ISpeechObjectToken,
2679     ) -> HRESULT,
2680     fn putref_AudioOutput(
2681         AudioOutput: *mut ISpeechObjectToken,
2682     ) -> HRESULT,
2683     fn get_AudioOutputStream(
2684         AudioOutputStream: *mut *mut ISpeechBaseStream,
2685     ) -> HRESULT,
2686     fn putref_AudioOutputStream(
2687         AudioOutputStream: *mut ISpeechBaseStream,
2688     ) -> HRESULT,
2689     fn get_Rate(
2690         Rate: *mut c_long,
2691     ) -> HRESULT,
2692     fn put_Rate(
2693         Rate: c_long,
2694     ) -> HRESULT,
2695     fn get_Volume(
2696         Volume: *mut c_long,
2697     ) -> HRESULT,
2698     fn put_Volume(
2699         Volume: c_long,
2700     ) -> HRESULT,
2701     fn put_AllowAudioOutputFormatChangesOnNextSet(
2702         Allow: VARIANT_BOOL,
2703     ) -> HRESULT,
2704     fn get_AllowAudioOutputFormatChangesOnNextSet(
2705         Allow: *mut VARIANT_BOOL,
2706     ) -> HRESULT,
2707     fn get_EventInterests(
2708         EventInterestFlags: *mut SpeechVoiceEvents,
2709     ) -> HRESULT,
2710     fn put_EventInterests(
2711         EventInterestFlags: SpeechVoiceEvents,
2712     ) -> HRESULT,
2713     fn put_Priority(
2714         Priority: SpeechVoicePriority,
2715     ) -> HRESULT,
2716     fn get_Priority(
2717         Priority: *mut SpeechVoicePriority,
2718     ) -> HRESULT,
2719     fn put_AlertBoundary(
2720         Boundary: SpeechVoiceEvents,
2721     ) -> HRESULT,
2722     fn get_AlertBoundary(
2723         Boundary: *mut SpeechVoiceEvents,
2724     ) -> HRESULT,
2725     fn put_SynchronousSpeakTimeout(
2726         msTimeout: c_long,
2727     ) -> HRESULT,
2728     fn get_SynchronousSpeakTimeout(
2729         msTimeOut: *mut c_long,
2730     ) -> HRESULT,
2731     fn Speak(
2732         Text: BSTR,
2733         Flags: SpeechVoiceSpeakFlags,
2734         StreamNumber: *mut c_long,
2735     ) -> HRESULT,
2736     fn SpeakStream(
2737         Stream: *mut ISpeechBaseStream,
2738         Flags: SpeechVoiceSpeakFlags,
2739         StreamNumber: *mut c_long,
2740     ) -> HRESULT,
2741     fn Pause() -> HRESULT,
2742     fn Resume() -> HRESULT,
2743     fn Skip(
2744         Type: BSTR,
2745         NumItems: c_long,
2746         NumSkipped: c_long,
2747     ) -> HRESULT,
2748     fn GetVoices(
2749         RequiredAttributes: BSTR,
2750         OptionalAttributes: BSTR,
2751         ObjectTokens: *mut *mut ISpeechObjectTokens,
2752     ) -> HRESULT,
2753     fn GetAudioOutputs(
2754         RequiredAttributes: BSTR,
2755         OptionalAttributes: BSTR,
2756         ObjectTokens: *mut *mut ISpeechObjectTokens,
2757     ) -> HRESULT,
2758     fn WaitUntilDone(
2759         msTimeout: c_long,
2760         Done: *mut VARIANT_BOOL,
2761     ) -> HRESULT,
2762     fn SpeakCompleteEvent(
2763         Handle: *mut c_long,
2764     ) -> HRESULT,
2765     fn IsUISupported(
2766         TypeOfUI: BSTR,
2767         ExtraData: *const VARIANT,
2768         Supported: *mut VARIANT_BOOL,
2769     ) -> HRESULT,
2770     fn DisplayUI(
2771         hWndParent: c_long,
2772         Title: BSTR,
2773         TypeOfUI: BSTR,
2774         ExtraData: *const VARIANT,
2775     ) -> HRESULT,
2776 });
2777 RIDL!(#[uuid(0x8be47b07, 0x57f6, 0x11d2, 0x9e, 0xee, 0x00, 0xc0, 0x4f, 0x79, 0x73, 0x96)]
2778 interface ISpeechVoiceStatus(ISpeechVoiceStatusVtbl): IDispatch(IDispatchVtbl) {
2779     fn get_CurrentStreamNumber(
2780         StreamNumber: *mut c_long,
2781     ) -> HRESULT,
2782     fn get_LastStreamNumberQueued(
2783         StreamNumber: *mut c_long,
2784     ) -> HRESULT,
2785     fn get_LastHResult(
2786         HResult: *mut c_long,
2787     ) -> HRESULT,
2788     fn get_RunningState(
2789         State: *mut SpeechRunState,
2790     ) -> HRESULT,
2791     fn get_InputWordPosition(
2792         Position: *mut c_long,
2793     ) -> HRESULT,
2794     fn get_InputWordLength(
2795         Length: *mut c_long,
2796     ) -> HRESULT,
2797     fn get_InputSentencePosition(
2798         Position: *mut c_long,
2799     ) -> HRESULT,
2800     fn get_InputSentenceLength(
2801         Length: *mut c_long,
2802     ) -> HRESULT,
2803     fn get_LastBookmark(
2804         Bookmark: *mut BSTR,
2805     ) -> HRESULT,
2806     fn get_LastBookmarkId(
2807         BookmarkId: *mut c_long,
2808     ) -> HRESULT,
2809     fn get_PhonemeId(
2810         PhoneId: *mut c_short,
2811     ) -> HRESULT,
2812     fn get_VisemeId(
2813         VisemeId: *mut c_short,
2814     ) -> HRESULT,
2815 });
2816 RIDL!(#[uuid(0xa372acd1, 0x3bef, 0x4bbd, 0x8f, 0xfb, 0xcb, 0x3e, 0x2b, 0x41, 0x6a, 0xf8)]
2817 interface _ISpeechVoiceEvents(_ISpeechVoiceEventsVtbl): IDispatch(IDispatchVtbl) {
2818 });
2819 RIDL!(#[uuid(0x2d5f1c0c, 0xbd75, 0x4b08, 0x94, 0x78, 0x3b, 0x11, 0xfe, 0xa2, 0x58, 0x6c)]
2820 interface ISpeechRecognizer(ISpeechRecognizerVtbl): IDispatch(IDispatchVtbl) {
2821     fn putref_Recognizer(
2822         Recognizer: *mut ISpeechObjectToken,
2823     ) -> HRESULT,
2824     fn get_Recognizer(
2825         Recognizer: *mut *mut ISpeechObjectToken,
2826     ) -> HRESULT,
2827     fn put_AllowAudioInputFormatChangesOnNextSet(
2828         Allow: VARIANT_BOOL,
2829     ) -> HRESULT,
2830     fn get_AllowAudioInputFormatChangesOnNextSet(
2831         Allow: *mut VARIANT_BOOL,
2832     ) -> HRESULT,
2833     fn putref_AudioInput(
2834         AudioInput: *mut ISpeechObjectToken,
2835     ) -> HRESULT,
2836     fn get_AudioInput(
2837         AudioInput: *mut *mut ISpeechObjectToken,
2838     ) -> HRESULT,
2839     fn putref_AudioInputStream(
2840         AudioInputStream: *mut ISpeechBaseStream,
2841     ) -> HRESULT,
2842     fn get_AudioInputStream(
2843         AudioInputStream: *mut *mut ISpeechBaseStream,
2844     ) -> HRESULT,
2845     fn get_IsShared(
2846         Shared: *mut VARIANT_BOOL,
2847     ) -> HRESULT,
2848     fn put_State(
2849         State: SpeechRecognizerState,
2850     ) -> HRESULT,
2851     fn get_State(
2852         State: *mut SpeechRecognizerState,
2853     ) -> HRESULT,
2854     fn get_Status(
2855         Status: *mut *mut ISpeechRecognizerStatus,
2856     ) -> HRESULT,
2857     fn putref_Profile(
2858         Profile: *mut ISpeechObjectToken,
2859     ) -> HRESULT,
2860     fn get_Profile(
2861         Profile: *mut *mut ISpeechObjectToken,
2862     ) -> HRESULT,
2863     fn EmulateRecognition(
2864         TextElements: VARIANT,
2865         ElementDisplayAttributes: *mut VARIANT,
2866         LanguageId: c_long,
2867     ) -> HRESULT,
2868     fn CreateRecoContext(
2869         NewContext: *mut *mut ISpeechRecoContext,
2870     ) -> HRESULT,
2871     fn GetFormat(
2872         Type: SpeechFormatType,
2873         Format: *mut *mut ISpeechAudioFormat,
2874     ) -> HRESULT,
2875     fn SetPropertyNumber(
2876         Name: BSTR,
2877         Value: c_long,
2878         Supported: *mut VARIANT_BOOL,
2879     ) -> HRESULT,
2880     fn GetPropertyNumber(
2881         Name: BSTR,
2882         Value: *mut c_long,
2883         Supported: *mut VARIANT_BOOL,
2884     ) -> HRESULT,
2885     fn SetPropertyString(
2886         Name: BSTR,
2887         Value: BSTR,
2888         Supported: *mut VARIANT_BOOL,
2889     ) -> HRESULT,
2890     fn GetPropertyString(
2891         Name: BSTR,
2892         Value: *mut BSTR,
2893         Supported: *mut VARIANT_BOOL,
2894     ) -> HRESULT,
2895     fn IsUISupported(
2896         TypeOfUI: BSTR,
2897         ExtraData: *const VARIANT,
2898         Supported: *mut VARIANT_BOOL,
2899     ) -> HRESULT,
2900     fn DisplayUI(
2901         hWndParent: c_long,
2902         Title: BSTR,
2903         TypeOfUI: BSTR,
2904         ExtraData: *const VARIANT,
2905     ) -> HRESULT,
2906     fn GetRecognizers(
2907         RequiredAttributes: BSTR,
2908         OptionalAttributes: BSTR,
2909         ObjectTokens: *mut *mut ISpeechObjectTokens,
2910     ) -> HRESULT,
2911     fn GetAudioInputs(
2912         RequiredAttributes: BSTR,
2913         OptionalAttributes: BSTR,
2914         ObjectTokens: *mut *mut ISpeechObjectTokens,
2915     ) -> HRESULT,
2916     fn GetProfiles(
2917         RequiredAttributes: BSTR,
2918         OptionalAttributes: BSTR,
2919         ObjectTokens: *mut *mut ISpeechObjectTokens,
2920     ) -> HRESULT,
2921 });
2922 RIDL!(#[uuid(0xbff9e781, 0x53ec, 0x484e, 0xbb, 0x8a, 0x0e, 0x1b, 0x55, 0x51, 0xe3, 0x5c)]
2923 interface ISpeechRecognizerStatus(ISpeechRecognizerStatusVtbl): IDispatch(IDispatchVtbl) {
2924     fn get_AudioStatus(
2925         AudioStatus: *mut *mut ISpeechAudioStatus,
2926     ) -> HRESULT,
2927     fn get_CurrentStreamPosition(
2928         pCurrentStreamPos: *mut VARIANT,
2929     ) -> HRESULT,
2930     fn get_CurrentStreamNumber(
2931         StreamNumber: *mut c_long,
2932     ) -> HRESULT,
2933     fn get_NumberOfActiveRules(
2934         NumberOfActiveRules: *mut c_long,
2935     ) -> HRESULT,
2936     fn get_ClsidEngine(
2937         ClsidEngine: *mut BSTR,
2938     ) -> HRESULT,
2939     fn get_SupportedLanguages(
2940         SupportedLanguages: *mut VARIANT,
2941     ) -> HRESULT,
2942 });
2943 RIDL!(#[uuid(0x580aa49d, 0x7e1e, 0x4809, 0xb8, 0xe2, 0x57, 0xda, 0x80, 0x61, 0x04, 0xb8)]
2944 interface ISpeechRecoContext(ISpeechRecoContextVtbl): IDispatch(IDispatchVtbl) {
2945     fn get_Recognizer(
2946         Recognizer: *mut *mut ISpeechRecognizer,
2947     ) -> HRESULT,
2948     fn get_AudioInputInterferenceStatus(
2949         Interference: *mut SpeechInterference,
2950     ) -> HRESULT,
2951     fn get_RequestedUIType(
2952         UIType: *mut BSTR,
2953     ) -> HRESULT,
2954     fn putref_Voice(
2955         Voice: *mut ISpeechVoice,
2956     ) -> HRESULT,
2957     fn get_Voice(
2958         Voice: *mut *mut ISpeechVoice,
2959     ) -> HRESULT,
2960     fn put_AllowVoiceFormatMatchingOnNextSet(
2961         Allow: VARIANT_BOOL,
2962     ) -> HRESULT,
2963     fn get_AllowVoiceFormatMatchingOnNextSet(
2964         Allow: *mut VARIANT_BOOL,
2965     ) -> HRESULT,
2966     fn put_VoicePurgeEvent(
2967         EventInterest: SpeechRecoEvents,
2968     ) -> HRESULT,
2969     fn get_VoicePurgeEvent(
2970         EventInterest: *mut SpeechRecoEvents,
2971     ) -> HRESULT,
2972     fn put_EventInterests(
2973         EventInterest: SpeechRecoEvents,
2974     ) -> HRESULT,
2975     fn get_EventInterests(
2976         EventInterest: *mut SpeechRecoEvents,
2977     ) -> HRESULT,
2978     fn put_CmdMaxAlternates(
2979         MaxAlternates: c_long,
2980     ) -> HRESULT,
2981     fn get_CmdMaxAlternates(
2982         MaxAlternates: *mut c_long,
2983     ) -> HRESULT,
2984     fn put_State(
2985         State: SpeechRecoContextState,
2986     ) -> HRESULT,
2987     fn get_State(
2988         State: *mut SpeechRecoContextState,
2989     ) -> HRESULT,
2990     fn put_RetainedAudio(
2991         Option: SpeechRetainedAudioOptions,
2992     ) -> HRESULT,
2993     fn get_RetainedAudio(
2994         Option: *mut SpeechRetainedAudioOptions,
2995     ) -> HRESULT,
2996     fn putref_RetainedAudioFormat(
2997         Format: *mut ISpeechAudioFormat,
2998     ) -> HRESULT,
2999     fn get_RetainedAudioFormat(
3000         Format: *mut *mut ISpeechAudioFormat,
3001     ) -> HRESULT,
3002     fn Pause() -> HRESULT,
3003     fn Resume() -> HRESULT,
3004     fn CreateGrammar(
3005         GrammarId: VARIANT,
3006         Grammar: *mut *mut ISpeechRecoGrammar,
3007     ) -> HRESULT,
3008     fn CreateResultFromMemory(
3009         ResultBlock: *mut VARIANT,
3010         Result: *mut *mut ISpeechRecoResult,
3011     ) -> HRESULT,
3012     fn Bookmark(
3013         Options: SpeechBookmarkOptions,
3014         StreamPos: VARIANT,
3015         BookmarkId: VARIANT,
3016     ) -> HRESULT,
3017     fn SetAdaptationData(
3018         AdaptationString: BSTR,
3019     ) -> HRESULT,
3020 });
3021 RIDL!(#[uuid(0xb6d6f79f, 0x2158, 0x4e50, 0xb5, 0xbc, 0x9a, 0x9c, 0xcd, 0x85, 0x2a, 0x09)]
3022 interface ISpeechRecoGrammar(ISpeechRecoGrammarVtbl): IDispatch(IDispatchVtbl) {
3023     fn get_Id(
3024         Id: *mut VARIANT,
3025     ) -> HRESULT,
3026     fn get_RecoContext(
3027         RecoContext: *mut *mut ISpeechRecoContext,
3028     ) -> HRESULT,
3029     fn put_State(
3030         State: SpeechGrammarState,
3031     ) -> HRESULT,
3032     fn get_State(
3033         State: *mut SpeechGrammarState,
3034     ) -> HRESULT,
3035     fn get_Rules(
3036         Rules: *mut *mut ISpeechGrammarRules,
3037     ) -> HRESULT,
3038     fn Reset(
3039         NewLanguage: SpeechLanguageId,
3040     ) -> HRESULT,
3041     fn CmdLoadFromFile(
3042         FileName: BSTR,
3043         LoadOption: SpeechLoadOption,
3044     ) -> HRESULT,
3045     fn CmdLoadFromObject(
3046         ClassId: BSTR,
3047         GrammarName: BSTR,
3048         LoadOption: SpeechLoadOption,
3049     ) -> HRESULT,
3050     fn CmdLoadFromResource(
3051         hModule: c_long,
3052         ResourceName: VARIANT,
3053         ResourceType: VARIANT,
3054         LanguageId: SpeechLanguageId,
3055         LoadOption: SpeechLoadOption,
3056     ) -> HRESULT,
3057     fn CmdLoadFromMemory(
3058         GrammarData: VARIANT,
3059         LoadOption: SpeechLoadOption,
3060     ) -> HRESULT,
3061     fn CmdLoadFromProprietaryGrammar(
3062         ProprietaryGuid: BSTR,
3063         PriorietaryString: BSTR,
3064         ProprietaryData: VARIANT,
3065         LoadOption: SpeechLoadOption,
3066     ) -> HRESULT,
3067     fn CmdSetRuleState(
3068         Name: BSTR,
3069         State: SpeechRuleState,
3070     ) -> HRESULT,
3071     fn CmdSetRuleIdState(
3072         RuleId: c_long,
3073         State: SpeechRuleState,
3074     ) -> HRESULT,
3075     fn DictationLoad(
3076         TopicName: BSTR,
3077         LoadOption: SpeechLoadOption,
3078     ) -> HRESULT,
3079     fn DictationUnload() -> HRESULT,
3080     fn DictationSetState(
3081         State: SpeechRuleState,
3082     ) -> HRESULT,
3083     fn SetWordSequenceData(
3084         Text: BSTR,
3085         TextLength: c_long,
3086         Info: *mut ISpeechTextSelectionInformation,
3087     ) -> HRESULT,
3088     fn SetTextSelection(
3089         Info: *mut ISpeechTextSelectionInformation,
3090     ) -> HRESULT,
3091     fn IsPronounceable(
3092         Word: BSTR,
3093         WordPronounceable: *mut SpeechWordPronounceable,
3094     ) -> HRESULT,
3095 });
3096 RIDL!(#[uuid(0x7b8fcb42, 0x0e9d, 0x4f00, 0xa0, 0x48, 0x7b, 0x04, 0xd6, 0x17, 0x9d, 0x3d)]
3097 interface _ISpeechRecoContextEvents(_ISpeechRecoContextEventsVtbl): IDispatch(IDispatchVtbl) {
3098 });
3099 RIDL!(#[uuid(0xafe719cf, 0x5dd1, 0x44f2, 0x99, 0x9c, 0x7a, 0x39, 0x9f, 0x1c, 0xfc, 0xcc)]
3100 interface ISpeechGrammarRule(ISpeechGrammarRuleVtbl): IDispatch(IDispatchVtbl) {
3101     fn get_Attributes(
3102         Attributes: *mut SpeechRuleAttributes,
3103     ) -> HRESULT,
3104     fn get_InitialState(
3105         State: *mut *mut ISpeechGrammarRuleState,
3106     ) -> HRESULT,
3107     fn get_Name(
3108         Name: *mut BSTR,
3109     ) -> HRESULT,
3110     fn get_Id(
3111         Id: *mut c_long,
3112     ) -> HRESULT,
3113     fn Clear() -> HRESULT,
3114     fn AddResource(
3115         ResourceName: BSTR,
3116         ResourceValue: BSTR,
3117     ) -> HRESULT,
3118     fn AddState(
3119         State: *mut *mut ISpeechGrammarRuleState,
3120     ) -> HRESULT,
3121 });
3122 RIDL!(#[uuid(0x6ffa3b44, 0xfc2d, 0x40d1, 0x8a, 0xfc, 0x32, 0x91, 0x1c, 0x7f, 0x1a, 0xd1)]
3123 interface ISpeechGrammarRules(ISpeechGrammarRulesVtbl): IDispatch(IDispatchVtbl) {
3124     fn get_Count(
3125         Count: *mut c_long,
3126     ) -> HRESULT,
3127     fn FindRule(
3128         RuleNameOrId: VARIANT,
3129         Rule: *mut *mut ISpeechGrammarRule,
3130     ) -> HRESULT,
3131     fn Item(
3132         Index: c_long,
3133         Rule: *mut *mut ISpeechGrammarRule,
3134     ) -> HRESULT,
3135     fn get__NewEnum(
3136         EnumVARIANT: *mut *mut IUnknown,
3137     ) -> HRESULT,
3138     fn get_Dynamic(
3139         Dynamic: *mut VARIANT_BOOL,
3140     ) -> HRESULT,
3141     fn Add(
3142         RuleName: BSTR,
3143         Attributes: SpeechRuleAttributes,
3144         RuleId: c_long,
3145         Rule: *mut *mut ISpeechGrammarRule,
3146     ) -> HRESULT,
3147     fn Commit() -> HRESULT,
3148     fn CommitAndSave(
3149         ErrorText: *mut BSTR,
3150         SaveStream: *mut VARIANT,
3151     ) -> HRESULT,
3152 });
3153 RIDL!(#[uuid(0xd4286f2c, 0xee67, 0x45ae, 0xb9, 0x28, 0x28, 0xd6, 0x95, 0x36, 0x2e, 0xda)]
3154 interface ISpeechGrammarRuleState(ISpeechGrammarRuleStateVtbl): IDispatch(IDispatchVtbl) {
3155     fn get_Rule(
3156         Rule: *mut *mut ISpeechGrammarRule,
3157     ) -> HRESULT,
3158     fn get_Transitions(
3159         Transitions: *mut *mut ISpeechGrammarRuleStateTransitions,
3160     ) -> HRESULT,
3161     fn AddWordTransition(
3162         DestState: *mut ISpeechGrammarRuleState,
3163         Words: BSTR,
3164         Separators: BSTR,
3165         Type: SpeechGrammarWordType,
3166         PropertyName: BSTR,
3167         PropertyId: c_long,
3168         PropertyValue: *mut VARIANT,
3169         Weight: c_float,
3170     ) -> HRESULT,
3171     fn AddRuleTransition(
3172         DestinationState: *mut ISpeechGrammarRuleState,
3173         Rule: *mut ISpeechGrammarRule,
3174         PropertyName: BSTR,
3175         PropertyId: c_long,
3176         PropertyValue: *mut VARIANT,
3177         Weight: c_float,
3178     ) -> HRESULT,
3179     fn AddSpecialTransition(
3180         DestinationState: *mut ISpeechGrammarRuleState,
3181         Type: SpeechSpecialTransitionType,
3182         PropertyName: BSTR,
3183         PropertyId: c_long,
3184         PropertyValue: *mut VARIANT,
3185         Weight: c_float,
3186     ) -> HRESULT,
3187 });
3188 RIDL!(#[uuid(0xcafd1db1, 0x41d1, 0x4a06, 0x98, 0x63, 0xe2, 0xe8, 0x1d, 0xa1, 0x7a, 0x9a)]
3189 interface ISpeechGrammarRuleStateTransition(ISpeechGrammarRuleStateTransitionVtbl):
3190     IDispatch(IDispatchVtbl) {
3191     fn get_Type(
3192         Type: *mut SpeechGrammarRuleStateTransitionType,
3193     ) -> HRESULT,
3194     fn get_Text(
3195         Text: *mut BSTR,
3196     ) -> HRESULT,
3197     fn get_Rule(
3198         Rule: *mut *mut ISpeechGrammarRule,
3199     ) -> HRESULT,
3200     fn get_Weight(
3201         Weight: *mut VARIANT,
3202     ) -> HRESULT,
3203     fn get_PropertyName(
3204         PropertyName: *mut BSTR,
3205     ) -> HRESULT,
3206     fn get_PropertyId(
3207         PropertyId: *mut c_long,
3208     ) -> HRESULT,
3209     fn get_PropertyValue(
3210         PropertyValue: *mut VARIANT,
3211     ) -> HRESULT,
3212     fn get_NextState(
3213         NextState: *mut *mut ISpeechGrammarRuleState,
3214     ) -> HRESULT,
3215 });
3216 RIDL!(#[uuid(0xeabce657, 0x75bc, 0x44a2, 0xaa, 0x7f, 0xc5, 0x64, 0x76, 0x74, 0x29, 0x63)]
3217 interface ISpeechGrammarRuleStateTransitions(ISpeechGrammarRuleStateTransitionsVtbl):
3218     IDispatch(IDispatchVtbl) {
3219     fn get_Count(
3220         Count: *mut c_long,
3221     ) -> HRESULT,
3222     fn Item(
3223         Index: c_long,
3224         Transition: *mut *mut ISpeechGrammarRuleStateTransition,
3225     ) -> HRESULT,
3226     fn get__NewEnum(
3227         EnumVARIANT: *mut *mut IUnknown,
3228     ) -> HRESULT,
3229 });
3230 RIDL!(#[uuid(0x3b9c7e7a, 0x6eee, 0x4ded, 0x90, 0x92, 0x11, 0x65, 0x72, 0x79, 0xad, 0xbe)]
3231 interface ISpeechTextSelectionInformation(ISpeechTextSelectionInformationVtbl):
3232     IDispatch(IDispatchVtbl) {
3233     fn put_ActiveOffset(
3234         ActiveOffset: c_long,
3235     ) -> HRESULT,
3236     fn get_ActiveOffset(
3237         ActiveOffset: *mut c_long,
3238     ) -> HRESULT,
3239     fn put_ActiveLength(
3240         ActiveLength: c_long,
3241     ) -> HRESULT,
3242     fn get_ActiveLength(
3243         ActiveLength: *mut c_long,
3244     ) -> HRESULT,
3245     fn put_SelectionOffset(
3246         SelectionOffset: c_long,
3247     ) -> HRESULT,
3248     fn get_SelectionOffset(
3249         SelectionOffset: *mut c_long,
3250     ) -> HRESULT,
3251     fn put_SelectionLength(
3252         SelectionLength: c_long,
3253     ) -> HRESULT,
3254     fn get_SelectionLength(
3255         SelectionLength: *mut c_long,
3256     ) -> HRESULT,
3257 });
3258 RIDL!(#[uuid(0xed2879cf, 0xced9, 0x4ee6, 0xa5, 0x34, 0xde, 0x01, 0x91, 0xd5, 0x46, 0x8d)]
3259 interface ISpeechRecoResult(ISpeechRecoResultVtbl): IDispatch(IDispatchVtbl) {
3260     fn get_RecoContext(
3261         RecoContext: *mut *mut ISpeechRecoContext,
3262     ) -> HRESULT,
3263     fn get_Times(
3264         Times: *mut *mut ISpeechRecoResultTimes,
3265     ) -> HRESULT,
3266     fn putref_AudioFormat(
3267         Format: *mut ISpeechAudioFormat,
3268     ) -> HRESULT,
3269     fn get_AudioFormat(
3270         Format: *mut *mut ISpeechAudioFormat,
3271     ) -> HRESULT,
3272     fn get_PhraseInfo(
3273         PhraseInfo: *mut *mut ISpeechPhraseInfo,
3274     ) -> HRESULT,
3275     fn Alternates(
3276         RequestCount: c_long,
3277         StartElement: c_long,
3278         Elements: c_long,
3279         Alternates: *mut *mut ISpeechPhraseAlternates,
3280     ) -> HRESULT,
3281     fn Audio(
3282         StartElement: c_long,
3283         Elements: c_long,
3284         Stream: *mut *mut ISpeechMemoryStream,
3285     ) -> HRESULT,
3286     fn SpeakAudio(
3287         StartElement: c_long,
3288         Elements: c_long,
3289         Flags: SpeechVoiceSpeakFlags,
3290         StreamNumber: *mut c_long,
3291     ) -> HRESULT,
3292     fn SaveToMemory(
3293         ResultBlock: *mut VARIANT,
3294     ) -> HRESULT,
3295     fn DiscardResultInfo(
3296         ValueTypes: SpeechDiscardType,
3297     ) -> HRESULT,
3298 });
3299 RIDL!(#[uuid(0x62b3b8fb, 0xf6e7, 0x41be, 0xbd, 0xcb, 0x05, 0x6b, 0x1c, 0x29, 0xef, 0xc0)]
3300 interface ISpeechRecoResultTimes(ISpeechRecoResultTimesVtbl): IDispatch(IDispatchVtbl) {
3301     fn get_StreamTime(
3302         Time: *mut VARIANT,
3303     ) -> HRESULT,
3304     fn get_Length(
3305         Length: *mut VARIANT,
3306     ) -> HRESULT,
3307     fn get_TickCount(
3308         TickCount: *mut c_long,
3309     ) -> HRESULT,
3310     fn get_OffsetFromStart(
3311         OffsetFromStart: *mut VARIANT,
3312     ) -> HRESULT,
3313 });
3314 RIDL!(#[uuid(0x27864a2a, 0x2b9f, 0x4cb8, 0x92, 0xd3, 0x0d, 0x27, 0x22, 0xfd, 0x1e, 0x73)]
3315 interface ISpeechPhraseAlternate(ISpeechPhraseAlternateVtbl): IDispatch(IDispatchVtbl) {
3316     fn get_RecoResult(
3317         RecoResult: *mut *mut ISpeechRecoResult,
3318     ) -> HRESULT,
3319     fn get_StartElementInResult(
3320         StartElement: *mut c_long,
3321     ) -> HRESULT,
3322     fn get_NumberOfElementsInResult(
3323         NumberOfElements: *mut c_long,
3324     ) -> HRESULT,
3325     fn get_PhraseInfo(
3326         PhraseInfo: *mut *mut ISpeechPhraseInfo,
3327     ) -> HRESULT,
3328     fn Commit() -> HRESULT,
3329 });
3330 RIDL!(#[uuid(0xb238b6d5, 0xf276, 0x4c3d, 0xa6, 0xc1, 0x29, 0x74, 0x80, 0x1c, 0x3c, 0xc2)]
3331 interface ISpeechPhraseAlternates(ISpeechPhraseAlternatesVtbl): IDispatch(IDispatchVtbl) {
3332     fn get_Count(
3333         Count: *mut c_long,
3334     ) -> HRESULT,
3335     fn Item(
3336         Index: c_long,
3337         PhraseAlternate: *mut *mut ISpeechPhraseAlternate,
3338     ) -> HRESULT,
3339     fn get__NewEnum(
3340         EnumVARIANT: *mut *mut IUnknown,
3341     ) -> HRESULT,
3342 });
3343 RIDL!(#[uuid(0x961559cf, 0x4e67, 0x4662, 0x8b, 0xf0, 0xd9, 0x3f, 0x1f, 0xcd, 0x61, 0xb3)]
3344 interface ISpeechPhraseInfo(ISpeechPhraseInfoVtbl): IDispatch(IDispatchVtbl) {
3345     fn get_LanguageId(
3346         LanguageId: *mut c_long,
3347     ) -> HRESULT,
3348     fn get_GrammarId(
3349         GrammarId: *mut VARIANT,
3350     ) -> HRESULT,
3351     fn get_StartTime(
3352         StartTime: *mut VARIANT,
3353     ) -> HRESULT,
3354     fn get_AudioStreamPosition(
3355         AudioStreamPosition: *mut VARIANT,
3356     ) -> HRESULT,
3357     fn get_AudioSizeBytes(
3358         pAudioSizeBytes: *mut c_long,
3359     ) -> HRESULT,
3360     fn get_RetainedSizeBytes(
3361         RetainedSizeBytes: *mut c_long,
3362     ) -> HRESULT,
3363     fn get_AudioSizeTime(
3364         AudioSizeTime: *mut c_long,
3365     ) -> HRESULT,
3366     fn get_Rule(
3367         Rule: *mut *mut ISpeechPhraseRule,
3368     ) -> HRESULT,
3369     fn get_Properties(
3370         Properties: *mut *mut ISpeechPhraseProperties,
3371     ) -> HRESULT,
3372     fn get_Elements(
3373         Elements: *mut *mut ISpeechPhraseElements,
3374     ) -> HRESULT,
3375     fn get_Replacements(
3376         Replacements: *mut *mut ISpeechPhraseReplacements,
3377     ) -> HRESULT,
3378     fn get_EngineId(
3379         EngineIdGuid: *mut BSTR,
3380     ) -> HRESULT,
3381     fn get_EnginePrivateData(
3382         PrivateData: *mut VARIANT,
3383     ) -> HRESULT,
3384     fn SaveToMemory(
3385         PhraseBlock: *mut VARIANT,
3386     ) -> HRESULT,
3387     fn GetText(
3388         StartElement: c_long,
3389         Elements: c_long,
3390         UseReplacements: VARIANT_BOOL,
3391         Text: *mut BSTR,
3392     ) -> HRESULT,
3393     fn GetDisplayAttributes(
3394         StartElement: c_long,
3395         Elements: c_long,
3396         UseReplacements: VARIANT_BOOL,
3397         DisplayAttributes: *mut SpeechDisplayAttributes,
3398     ) -> HRESULT,
3399 });
3400 RIDL!(#[uuid(0xe6176f96, 0xe373, 0x4801, 0xb2, 0x23, 0x3b, 0x62, 0xc0, 0x68, 0xc0, 0xb4)]
3401 interface ISpeechPhraseElement(ISpeechPhraseElementVtbl): IDispatch(IDispatchVtbl) {
3402     fn get_AudioTimeOffset(
3403         AudioTimeOffset: *mut c_long,
3404     ) -> HRESULT,
3405     fn get_AudioSizeTime(
3406         AudioSizeTime: *mut c_long,
3407     ) -> HRESULT,
3408     fn get_AudioStreamOffset(
3409         AudioStreamOffset: *mut c_long,
3410     ) -> HRESULT,
3411     fn get_AudioSizeBytes(
3412         AudioSizeBytes: *mut c_long,
3413     ) -> HRESULT,
3414     fn get_RetainedStreamOffset(
3415         RetainedStreamOffset: *mut c_long,
3416     ) -> HRESULT,
3417     fn get_RetainedSizeBytes(
3418         RetainedSizeBytes: *mut c_long,
3419     ) -> HRESULT,
3420     fn get_DisplayText(
3421         DisplayText: *mut BSTR,
3422     ) -> HRESULT,
3423     fn get_LexicalForm(
3424         LexicalForm: *mut BSTR,
3425     ) -> HRESULT,
3426     fn get_Pronunciation(
3427         Pronunciation: *mut VARIANT,
3428     ) -> HRESULT,
3429     fn get_DisplayAttributes(
3430         DisplayAttributes: *mut SpeechDisplayAttributes,
3431     ) -> HRESULT,
3432     fn get_RequiredConfidence(
3433         RequiredConfidence: *mut SpeechEngineConfidence,
3434     ) -> HRESULT,
3435     fn get_ActualConfidence(
3436         ActualConfidence: *mut SpeechEngineConfidence,
3437     ) -> HRESULT,
3438     fn get_EngineConfidence(
3439         EngineConfident: *mut c_float,
3440     ) -> HRESULT,
3441 });
3442 RIDL!(#[uuid(0x0626b328, 0x3478, 0x467d, 0xa0, 0xb3, 0xd0, 0x85, 0x3b, 0x93, 0xdd, 0xa3)]
3443 interface ISpeechPhraseElements(ISpeechPhraseElementsVtbl): IDispatch(IDispatchVtbl) {
3444     fn get_Count(
3445         Count: *mut c_long,
3446     ) -> HRESULT,
3447     fn Item(
3448         Index: c_long,
3449         Element: *mut *mut ISpeechPhraseElement,
3450     ) -> HRESULT,
3451     fn get__NewEnum(
3452         EnumVARIANT: *mut *mut IUnknown,
3453     ) -> HRESULT,
3454 });
3455 RIDL!(#[uuid(0x2890a410, 0x53a7, 0x4fb5, 0x94, 0xec, 0x06, 0xd4, 0x99, 0x8e, 0x3d, 0x02)]
3456 interface ISpeechPhraseReplacement(ISpeechPhraseReplacementVtbl): IDispatch(IDispatchVtbl) {
3457     fn get_DisplayAttributes(
3458         DisplayAttributes: *mut SpeechDisplayAttributes,
3459     ) -> HRESULT,
3460     fn get_Text(
3461         Text: *mut BSTR,
3462     ) -> HRESULT,
3463     fn get_FirstElement(
3464         FirstElement: *mut c_long,
3465     ) -> HRESULT,
3466     fn get_NumberOfElements(
3467         NumberOfElements: *mut c_long,
3468     ) -> HRESULT,
3469 });
3470 RIDL!(#[uuid(0x38bc662f, 0x2257, 0x4525, 0x95, 0x9e, 0x20, 0x69, 0xd2, 0x59, 0x6c, 0x05)]
3471 interface ISpeechPhraseReplacements(ISpeechPhraseReplacementsVtbl): IDispatch(IDispatchVtbl) {
3472     fn get_Count(
3473         Count: *mut c_long,
3474     ) -> HRESULT,
3475     fn Item(
3476         Index: c_long,
3477         Reps: *mut *mut ISpeechPhraseReplacement,
3478     ) -> HRESULT,
3479     fn get__NewEnum(
3480         EnumVARIANT: *mut *mut IUnknown,
3481     ) -> HRESULT,
3482 });
3483 RIDL!(#[uuid(0xce563d48, 0x961e, 0x4732, 0xa2, 0xe1, 0x37, 0x8a, 0x42, 0xb4, 0x30, 0xbe)]
3484 interface ISpeechPhraseProperty(ISpeechPhrasePropertyVtbl): IDispatch(IDispatchVtbl) {
3485     fn get_Name(
3486         Name: *mut BSTR,
3487     ) -> HRESULT,
3488     fn get_Id(
3489         Id: *mut c_long,
3490     ) -> HRESULT,
3491     fn get_Value(
3492         Value: *mut VARIANT,
3493     ) -> HRESULT,
3494     fn get_FirstElement(
3495         FirstElement: *mut c_long,
3496     ) -> HRESULT,
3497     fn get_NumberOfElements(
3498         NumberOfElements: *mut c_long,
3499     ) -> HRESULT,
3500     fn get_EngineConfidence(
3501         Confidence: *mut c_float,
3502     ) -> HRESULT,
3503     fn get_Confidence(
3504         Confidence: *mut SpeechEngineConfidence,
3505     ) -> HRESULT,
3506     fn get_Parent(
3507         ParentProperty: *mut *mut ISpeechPhraseProperty,
3508     ) -> HRESULT,
3509     fn get_Children(
3510         Children: *mut *mut ISpeechPhraseProperties,
3511     ) -> HRESULT,
3512 });
3513 RIDL!(#[uuid(0x08166b47, 0x102e, 0x4b23, 0xa5, 0x99, 0xbd, 0xb9, 0x8d, 0xbf, 0xd1, 0xf4)]
3514 interface ISpeechPhraseProperties(ISpeechPhrasePropertiesVtbl): IDispatch(IDispatchVtbl) {
3515     fn get_Count(
3516         Count: *mut c_long,
3517     ) -> HRESULT,
3518     fn Item(
3519         Index: c_long,
3520         Property: *mut *mut ISpeechPhraseProperty,
3521     ) -> HRESULT,
3522     fn get__NewEnum(
3523         EnumVARIANT: *mut *mut IUnknown,
3524     ) -> HRESULT,
3525 });
3526 RIDL!(#[uuid(0xa7bfe112, 0xa4a0, 0x48d9, 0xb6, 0x02, 0xc3, 0x13, 0x84, 0x3f, 0x69, 0x64)]
3527 interface ISpeechPhraseRule(ISpeechPhraseRuleVtbl): IDispatch(IDispatchVtbl) {
3528     fn get_Name(
3529         Name: *mut BSTR,
3530     ) -> HRESULT,
3531     fn get_Id(
3532         Id: *mut c_long,
3533     ) -> HRESULT,
3534     fn get_FirstElement(
3535         FirstElement: *mut c_long,
3536     ) -> HRESULT,
3537     fn get_NumberOfElements(
3538         NumberOfElements: *mut c_long,
3539     ) -> HRESULT,
3540     fn get_Parent(
3541         Parent: *mut *mut ISpeechPhraseRule,
3542     ) -> HRESULT,
3543     fn get_Children(
3544         Children: *mut *mut ISpeechPhraseRules,
3545     ) -> HRESULT,
3546     fn get_Confidence(
3547         ActualConfidence: *mut SpeechEngineConfidence,
3548     ) -> HRESULT,
3549     fn get_EngineConfidence(
3550         Confidence: *mut c_float,
3551     ) -> HRESULT,
3552 });
3553 RIDL!(#[uuid(0x9047d593, 0x01dd, 0x4b72, 0x81, 0xa3, 0xe4, 0xa0, 0xca, 0x69, 0xf4, 0x07)]
3554 interface ISpeechPhraseRules(ISpeechPhraseRulesVtbl): IDispatch(IDispatchVtbl) {
3555     fn get_Count(
3556         Count: *mut c_long,
3557     ) -> HRESULT,
3558     fn Item(
3559         Index: c_long,
3560         Rule: *mut *mut ISpeechPhraseRule,
3561     ) -> HRESULT,
3562     fn get__NewEnum(
3563         EnumVARIANT: *mut *mut IUnknown,
3564     ) -> HRESULT,
3565 });
3566 RIDL!(#[uuid(0x3da7627a, 0xc7ae, 0x4b23, 0x87, 0x08, 0x63, 0x8c, 0x50, 0x36, 0x2c, 0x25)]
3567 interface ISpeechLexicon(ISpeechLexiconVtbl): IDispatch(IDispatchVtbl) {
3568     fn get_GenerationId(
3569         GenerationId: *mut c_long,
3570     ) -> HRESULT,
3571     fn GetWords(
3572         Flags: SpeechLexiconType,
3573         GenerationID: *mut c_long,
3574         Words: *mut *mut ISpeechLexiconWords,
3575     ) -> HRESULT,
3576     fn AddPronunciation(
3577         bstrWord: BSTR,
3578         LangId: SpeechLanguageId,
3579         PartOfSpeech: SpeechPartOfSpeech,
3580         bstrPronunciation: BSTR,
3581     ) -> HRESULT,
3582     fn AddPronunciationByPhoneIds(
3583         bstrWord: BSTR,
3584         LangId: SpeechLanguageId,
3585         PartOfSpeech: SpeechPartOfSpeech,
3586         PhoneIds: *mut VARIANT,
3587     ) -> HRESULT,
3588     fn RemovePronunciation(
3589         bstrWord: BSTR,
3590         LangId: SpeechLanguageId,
3591         PartOfSpeech: SpeechPartOfSpeech,
3592         bstrPronunciation: BSTR,
3593     ) -> HRESULT,
3594     fn RemovePronunciationByPhoneIds(
3595         bstrWord: BSTR,
3596         LangId: SpeechLanguageId,
3597         PartOfSpeech: SpeechPartOfSpeech,
3598         PhoneIds: *mut VARIANT,
3599     ) -> HRESULT,
3600     fn GetPronunciations(
3601         bstrWord: BSTR,
3602         LangId: SpeechLanguageId,
3603         TypeFlags: SpeechLexiconType,
3604         ppPronunciations: *mut *mut ISpeechLexiconPronunciations,
3605     ) -> HRESULT,
3606     fn GetGenerationChange(
3607         GenerationID: *mut c_long,
3608         ppWords: *mut *mut ISpeechLexiconWords,
3609     ) -> HRESULT,
3610 });
3611 RIDL!(#[uuid(0x8d199862, 0x415e, 0x47d5, 0xac, 0x4f, 0xfa, 0xa6, 0x08, 0xb4, 0x24, 0xe6)]
3612 interface ISpeechLexiconWords(ISpeechLexiconWordsVtbl): IDispatch(IDispatchVtbl) {
3613     fn get_Count(
3614         Count: *mut c_long,
3615     ) -> HRESULT,
3616     fn Item(
3617         Index: c_long,
3618         Word: *mut *mut ISpeechLexiconWord,
3619     ) -> HRESULT,
3620     fn get__NewEnum(
3621         EnumVARIANT: *mut *mut IUnknown,
3622     ) -> HRESULT,
3623 });
3624 RIDL!(#[uuid(0x4e5b933c, 0xc9be, 0x48ed, 0x88, 0x42, 0x1e, 0xe5, 0x1b, 0xb1, 0xd4, 0xff)]
3625 interface ISpeechLexiconWord(ISpeechLexiconWordVtbl): IDispatch(IDispatchVtbl) {
3626     fn get_LangId(
3627         LangId: *mut SpeechLanguageId,
3628     ) -> HRESULT,
3629     fn get_Type(
3630         WordType: *mut SpeechWordType,
3631     ) -> HRESULT,
3632     fn get_Word(
3633         Word: *mut BSTR,
3634     ) -> HRESULT,
3635     fn get_Pronunciations(
3636         Pronunciations: *mut *mut ISpeechLexiconPronunciations,
3637     ) -> HRESULT,
3638 });
3639 RIDL!(#[uuid(0x72829128, 0x5682, 0x4704, 0xa0, 0xd4, 0x3e, 0x2b, 0xb6, 0xf2, 0xea, 0xd3)]
3640 interface ISpeechLexiconPronunciations(ISpeechLexiconPronunciationsVtbl):
3641     IDispatch(IDispatchVtbl) {
3642     fn get_Count(
3643         Count: *mut c_long,
3644     ) -> HRESULT,
3645     fn Item(
3646         Index: c_long,
3647         Pronunciation: *mut *mut ISpeechLexiconPronunciation,
3648     ) -> HRESULT,
3649     fn get__NewEnum(
3650         EnumVARIANT: *mut *mut IUnknown,
3651     ) -> HRESULT,
3652 });
3653 RIDL!(#[uuid(0x95252c5d, 0x9e43, 0x4f4a, 0x98, 0x99, 0x48, 0xee, 0x73, 0x35, 0x2f, 0x9f)]
3654 interface ISpeechLexiconPronunciation(ISpeechLexiconPronunciationVtbl): IDispatch(IDispatchVtbl) {
3655     fn get_Type(
3656         LexiconType: *mut SpeechLexiconType,
3657     ) -> HRESULT,
3658     fn get_LangId(
3659         LangId: *mut SpeechLanguageId,
3660     ) -> HRESULT,
3661     fn get_PartOfSpeech(
3662         PartOfSpeech: *mut SpeechPartOfSpeech,
3663     ) -> HRESULT,
3664     fn get_PhoneIds(
3665         PhoneIds: *mut VARIANT,
3666     ) -> HRESULT,
3667     fn get_Symbolic(
3668         Symbolic: *mut BSTR,
3669     ) -> HRESULT,
3670 });
3671 pub const Speech_Default_Weight: c_float = DEFAULT_WEIGHT;
3672 pub const Speech_Max_Word_Length: LONG = SP_MAX_WORD_LENGTH as i32;
3673 pub const Speech_Max_Pron_Length: LONG = SP_MAX_PRON_LENGTH as i32;
3674 pub const Speech_StreamPos_Asap: LONG = SP_STREAMPOS_ASAP as i32;
3675 pub const Speech_StreamPos_RealTime: LONG = SP_STREAMPOS_REALTIME as i32;
3676 pub const SpeechAllElements: LONG = SPPR_ALL_ELEMENTS as i32;
3677 RIDL!(#[uuid(0x3b151836, 0xdf3a, 0x4e0a, 0x84, 0x6c, 0xd2, 0xad, 0xc9, 0x33, 0x43, 0x33)]
3678 interface ISpeechPhraseInfoBuilder(ISpeechPhraseInfoBuilderVtbl): IDispatch(IDispatchVtbl) {
3679     fn RestorePhraseFromMemory(
3680         PhraseInMemory: *mut VARIANT,
3681         PhraseInfo: *mut *mut ISpeechPhraseInfo,
3682     ) -> HRESULT,
3683 });
3684 RIDL!(#[uuid(0xc3e4f353, 0x433f, 0x43d6, 0x89, 0xa1, 0x6a, 0x62, 0xa7, 0x05, 0x4c, 0x3d)]
3685 interface ISpeechPhoneConverter(ISpeechPhoneConverterVtbl): IDispatch(IDispatchVtbl) {
3686     fn get_LanguageId(
3687         LanguageId: *mut SpeechLanguageId,
3688     ) -> HRESULT,
3689     fn put_LanguageId(
3690         LanguageId: SpeechLanguageId,
3691     ) -> HRESULT,
3692     fn PhoneToId(
3693         Phonemes: BSTR,
3694         IdArray: *mut VARIANT,
3695     ) -> HRESULT,
3696     fn IdToPhone(
3697         IdArray: VARIANT,
3698         Phonemes: *mut BSTR,
3699     ) -> HRESULT,
3700 });
3701 extern {
3702     pub static CLSID_SpNotifyTranslator: CLSID;
3703     pub static CLSID_SpObjectTokenCategory: CLSID;
3704     pub static CLSID_SpObjectToken: CLSID;
3705     pub static CLSID_SpResourceManager: CLSID;
3706     pub static CLSID_SpStreamFormatConverter: CLSID;
3707     pub static CLSID_SpMMAudioEnum: CLSID;
3708     pub static CLSID_SpMMAudioIn: CLSID;
3709     pub static CLSID_SpMMAudioOut: CLSID;
3710     pub static CLSID_SpStream: CLSID;
3711     pub static CLSID_SpVoice: CLSID;
3712     pub static CLSID_SpSharedRecoContext: CLSID;
3713     pub static CLSID_SpInprocRecognizer: CLSID;
3714     pub static CLSID_SpSharedRecognizer: CLSID;
3715     pub static CLSID_SpLexicon: CLSID;
3716     pub static CLSID_SpUnCompressedLexicon: CLSID;
3717     pub static CLSID_SpCompressedLexicon: CLSID;
3718     pub static CLSID_SpPhoneConverter: CLSID;
3719     pub static CLSID_SpNullPhoneConverter: CLSID;
3720     pub static CLSID_SpTextSelectionInformation: CLSID;
3721     pub static CLSID_SpPhraseInfoBuilder: CLSID;
3722     pub static CLSID_SpAudioFormat: CLSID;
3723     pub static CLSID_SpWaveFormatEx: CLSID;
3724     pub static CLSID_SpInProcRecoContext: CLSID;
3725     pub static CLSID_SpCustomStream: CLSID;
3726     pub static CLSID_SpFileStream: CLSID;
3727     pub static CLSID_SpMemoryStream: CLSID;
3728 }
3729