1 // Licensed under the Apache License, Version 2.0
2 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4 // All files in the project carrying such notice may not be copied, modified, or distributed
5 // except according to those terms.
6 //! SAPI 5.1 definitions
7 use ctypes::{c_char, c_float, c_long, c_short, c_ushort, c_void};
8 use shared::guiddef::{CLSID, GUID, IID, REFCLSID, REFGUID, REFIID};
9 use shared::minwindef::{
10     BOOL, BYTE, DWORD, FILETIME, HKEY, HMODULE, LPARAM, UINT, ULONG, USHORT, WORD, WPARAM
11 };
12 use shared::mmreg::WAVEFORMATEX;
13 use shared::rpcndr::byte;
14 use shared::windef::HWND;
15 use shared::wtypes::{BSTR, VARIANT_BOOL};
16 use shared::wtypesbase::{
17     CLSCTX_INPROC_HANDLER, CLSCTX_INPROC_SERVER, CLSCTX_LOCAL_SERVER, CLSCTX_REMOTE_SERVER
18 };
19 use um::oaidl::{DISPID_NEWENUM, DISPID_VALUE, IDispatch, IDispatchVtbl, VARIANT};
20 use um::objidlbase::{IStream, IStreamVtbl, STREAM_SEEK_CUR, STREAM_SEEK_END, STREAM_SEEK_SET};
21 use um::servprov::{IServiceProvider, IServiceProviderVtbl};
22 use um::unknwnbase::{IUnknown, IUnknownVtbl};
23 use um::winnt::{HANDLE, HRESULT, LONG, LONGLONG, LPCWSTR, LPWSTR, ULONGLONG, WCHAR};
24 ENUM!{enum SPDATAKEYLOCATION {
25     SPDKL_DefaultLocation = 0,
26     SPDKL_CurrentUser = 1,
27     SPDKL_LocalMachine = 2,
28     SPDKL_CurrentConfig = 5,
29 }}
30 pub const SPDUI_EngineProperties: &'static str = "EngineProperties";
31 pub const SPDUI_AddRemoveWord: &'static str = "AddRemoveWord";
32 pub const SPDUI_UserTraining: &'static str = "UserTraining";
33 pub const SPDUI_MicTraining: &'static str = "MicTraining";
34 pub const SPDUI_RecoProfileProperties: &'static str = "RecoProfileProperties";
35 pub const SPDUI_AudioProperties: &'static str = "AudioProperties";
36 pub const SPDUI_AudioVolume: &'static str = "AudioVolume";
37 pub const SPDUI_UserEnrollment: &'static str = "UserEnrollment";
38 pub const SPDUI_ShareData: &'static str = "ShareData";
39 pub const SPDUI_Tutorial: &'static str = "Tutorial";
40 ENUM!{enum SPSTREAMFORMAT {
41     SPSF_Default = -1i32 as u32,
42     SPSF_NoAssignedFormat = 0,
43     SPSF_Text = 1,
44     SPSF_NonStandardFormat = 2,
45     SPSF_ExtendedAudioFormat = 3,
46     SPSF_8kHz8BitMono = 4,
47     SPSF_8kHz8BitStereo = 5,
48     SPSF_8kHz16BitMono = 6,
49     SPSF_8kHz16BitStereo = 7,
50     SPSF_11kHz8BitMono = 8,
51     SPSF_11kHz8BitStereo = 9,
52     SPSF_11kHz16BitMono = 10,
53     SPSF_11kHz16BitStereo = 11,
54     SPSF_12kHz8BitMono = 12,
55     SPSF_12kHz8BitStereo = 13,
56     SPSF_12kHz16BitMono = 14,
57     SPSF_12kHz16BitStereo = 15,
58     SPSF_16kHz8BitMono = 16,
59     SPSF_16kHz8BitStereo = 17,
60     SPSF_16kHz16BitMono = 18,
61     SPSF_16kHz16BitStereo = 19,
62     SPSF_22kHz8BitMono = 20,
63     SPSF_22kHz8BitStereo = 21,
64     SPSF_22kHz16BitMono = 22,
65     SPSF_22kHz16BitStereo = 23,
66     SPSF_24kHz8BitMono = 24,
67     SPSF_24kHz8BitStereo = 25,
68     SPSF_24kHz16BitMono = 26,
69     SPSF_24kHz16BitStereo = 27,
70     SPSF_32kHz8BitMono = 28,
71     SPSF_32kHz8BitStereo = 29,
72     SPSF_32kHz16BitMono = 30,
73     SPSF_32kHz16BitStereo = 31,
74     SPSF_44kHz8BitMono = 32,
75     SPSF_44kHz8BitStereo = 33,
76     SPSF_44kHz16BitMono = 34,
77     SPSF_44kHz16BitStereo = 35,
78     SPSF_48kHz8BitMono = 36,
79     SPSF_48kHz8BitStereo = 37,
80     SPSF_48kHz16BitMono = 38,
81     SPSF_48kHz16BitStereo = 39,
82     SPSF_TrueSpeech_8kHz1BitMono = 40,
83     SPSF_CCITT_ALaw_8kHzMono = 41,
84     SPSF_CCITT_ALaw_8kHzStereo = 42,
85     SPSF_CCITT_ALaw_11kHzMono = 43,
86     SPSF_CCITT_ALaw_11kHzStereo = 44,
87     SPSF_CCITT_ALaw_22kHzMono = 45,
88     SPSF_CCITT_ALaw_22kHzStereo = 46,
89     SPSF_CCITT_ALaw_44kHzMono = 47,
90     SPSF_CCITT_ALaw_44kHzStereo = 48,
91     SPSF_CCITT_uLaw_8kHzMono = 49,
92     SPSF_CCITT_uLaw_8kHzStereo = 50,
93     SPSF_CCITT_uLaw_11kHzMono = 51,
94     SPSF_CCITT_uLaw_11kHzStereo = 52,
95     SPSF_CCITT_uLaw_22kHzMono = 53,
96     SPSF_CCITT_uLaw_22kHzStereo = 54,
97     SPSF_CCITT_uLaw_44kHzMono = 55,
98     SPSF_CCITT_uLaw_44kHzStereo = 56,
99     SPSF_ADPCM_8kHzMono = 57,
100     SPSF_ADPCM_8kHzStereo = 58,
101     SPSF_ADPCM_11kHzMono = 59,
102     SPSF_ADPCM_11kHzStereo = 60,
103     SPSF_ADPCM_22kHzMono = 61,
104     SPSF_ADPCM_22kHzStereo = 62,
105     SPSF_ADPCM_44kHzMono = 63,
106     SPSF_ADPCM_44kHzStereo = 64,
107     SPSF_GSM610_8kHzMono = 65,
108     SPSF_GSM610_11kHzMono = 66,
109     SPSF_GSM610_22kHzMono = 67,
110     SPSF_GSM610_44kHzMono = 68,
111     SPSF_NUM_FORMATS = 69,
112 }}
113 extern {
114     pub static SPDFID_Text: GUID;
115     pub static SPDFID_WaveFormatEx: GUID;
116 }
117 pub const SPREG_USER_ROOT: &'static str = "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Speech";
118 pub const SPREG_LOCAL_MACHINE_ROOT: &'static str
119     = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech";
120 pub const SPCAT_AUDIOOUT: &'static str
121     = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\AudioOutput";
122 pub const SPCAT_AUDIOIN: &'static str
123     = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\AudioInput";
124 pub const SPCAT_VOICES: &'static str = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\Voices";
125 pub const SPCAT_RECOGNIZERS: &'static str
126     = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\Recognizers";
127 pub const SPCAT_APPLEXICONS: &'static str
128     = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\AppLexicons";
129 pub const SPCAT_PHONECONVERTERS: &'static str
130     = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\PhoneConverters";
131 pub const SPCAT_TEXTNORMALIZERS: &'static str
132     = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\TextNormalizers";
133 pub const SPCAT_RECOPROFILES: &'static str
134     = "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Speech\\RecoProfiles";
135 pub const SPMMSYS_AUDIO_IN_TOKEN_ID: &'static str
136     = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\AudioInput\\TokenEnums\\MMAudioIn\\";
137 pub const SPMMSYS_AUDIO_OUT_TOKEN_ID: &'static str
138     = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\AudioOutput\\TokenEnums\\MMAudioOut\\";
139 pub const SPCURRENT_USER_LEXICON_TOKEN_ID: &'static str
140     = "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Speech\\CurrentUserLexicon";
141 pub const SPCURRENT_USER_SHORTCUT_TOKEN_ID: &'static str
142     = "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Speech\\CurrentUserShortcut";
143 pub const SPTOKENVALUE_CLSID: &'static str = "CLSID";
144 pub const SPTOKENKEY_FILES: &'static str = "Files";
145 pub const SPTOKENKEY_UI: &'static str = "UI";
146 pub const SPTOKENKEY_ATTRIBUTES: &'static str = "Attributes";
147 pub const SPVOICECATEGORY_TTSRATE: &'static str = "DefaultTTSRate";
148 pub const SPPROP_RESOURCE_USAGE: &'static str = "ResourceUsage";
149 pub const SPPROP_HIGH_CONFIDENCE_THRESHOLD: &'static str = "HighConfidenceThreshold";
150 pub const SPPROP_NORMAL_CONFIDENCE_THRESHOLD: &'static str = "NormalConfidenceThreshold";
151 pub const SPPROP_LOW_CONFIDENCE_THRESHOLD: &'static str = "LowConfidenceThreshold";
152 pub const SPPROP_RESPONSE_SPEED: &'static str = "ResponseSpeed";
153 pub const SPPROP_COMPLEX_RESPONSE_SPEED: &'static str = "ComplexResponseSpeed";
154 pub const SPPROP_ADAPTATION_ON: &'static str = "AdaptationOn";
155 pub const SPPROP_PERSISTED_BACKGROUND_ADAPTATION: &'static str = "PersistedBackgroundAdaptation";
156 pub const SPPROP_PERSISTED_LANGUAGE_MODEL_ADAPTATION: &'static str
157     = "PersistedLanguageModelAdaptation";
158 pub const SPPROP_UX_IS_LISTENING: &'static str = "UXIsListening";
159 pub const SPTOPIC_SPELLING: &'static str = "Spelling";
160 pub const SPWILDCARD: &'static str = "...";
161 pub const SPDICTATION: &'static str = "*";
162 pub const SPINFDICTATION: &'static str = "*+";
163 pub const SP_LOW_CONFIDENCE: c_char = -1;
164 pub const SP_NORMAL_CONFIDENCE: c_char = 0;
165 pub const SP_HIGH_CONFIDENCE: c_char = 1;
166 pub const DEFAULT_WEIGHT: c_float = 1.0;
167 pub const SP_MAX_WORD_LENGTH: ULONG = 128;
168 pub const SP_MAX_PRON_LENGTH: ULONG = 384;
169 RIDL!{#[uuid(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)]
170 interface ISpNotifyCallback(ISpNotifyCallbackVtbl) {
171     fn NotifyCallback(
172         wParam: WPARAM,
173         lParam: LPARAM,
174     ) -> HRESULT,
175 }}
176 FN!{stdcall SPNOTIFYCALLBACK(
177     wParam: WPARAM,
178     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 RIDL!{#[uuid(0x2d5f1c0c, 0xbd75, 0x4b08, 0x94, 0x78, 0x3b, 0x11, 0xfe, 0xa2, 0x58, 0x6c)]
2819 interface ISpeechRecognizer(ISpeechRecognizerVtbl): IDispatch(IDispatchVtbl) {
2820     fn putref_Recognizer(
2821         Recognizer: *mut ISpeechObjectToken,
2822     ) -> HRESULT,
2823     fn get_Recognizer(
2824         Recognizer: *mut *mut ISpeechObjectToken,
2825     ) -> HRESULT,
2826     fn put_AllowAudioInputFormatChangesOnNextSet(
2827         Allow: VARIANT_BOOL,
2828     ) -> HRESULT,
2829     fn get_AllowAudioInputFormatChangesOnNextSet(
2830         Allow: *mut VARIANT_BOOL,
2831     ) -> HRESULT,
2832     fn putref_AudioInput(
2833         AudioInput: *mut ISpeechObjectToken,
2834     ) -> HRESULT,
2835     fn get_AudioInput(
2836         AudioInput: *mut *mut ISpeechObjectToken,
2837     ) -> HRESULT,
2838     fn putref_AudioInputStream(
2839         AudioInputStream: *mut ISpeechBaseStream,
2840     ) -> HRESULT,
2841     fn get_AudioInputStream(
2842         AudioInputStream: *mut *mut ISpeechBaseStream,
2843     ) -> HRESULT,
2844     fn get_IsShared(
2845         Shared: *mut VARIANT_BOOL,
2846     ) -> HRESULT,
2847     fn put_State(
2848         State: SpeechRecognizerState,
2849     ) -> HRESULT,
2850     fn get_State(
2851         State: *mut SpeechRecognizerState,
2852     ) -> HRESULT,
2853     fn get_Status(
2854         Status: *mut *mut ISpeechRecognizerStatus,
2855     ) -> HRESULT,
2856     fn putref_Profile(
2857         Profile: *mut ISpeechObjectToken,
2858     ) -> HRESULT,
2859     fn get_Profile(
2860         Profile: *mut *mut ISpeechObjectToken,
2861     ) -> HRESULT,
2862     fn EmulateRecognition(
2863         TextElements: VARIANT,
2864         ElementDisplayAttributes: *mut VARIANT,
2865         LanguageId: c_long,
2866     ) -> HRESULT,
2867     fn CreateRecoContext(
2868         NewContext: *mut *mut ISpeechRecoContext,
2869     ) -> HRESULT,
2870     fn GetFormat(
2871         Type: SpeechFormatType,
2872         Format: *mut *mut ISpeechAudioFormat,
2873     ) -> HRESULT,
2874     fn SetPropertyNumber(
2875         Name: BSTR,
2876         Value: c_long,
2877         Supported: *mut VARIANT_BOOL,
2878     ) -> HRESULT,
2879     fn GetPropertyNumber(
2880         Name: BSTR,
2881         Value: *mut c_long,
2882         Supported: *mut VARIANT_BOOL,
2883     ) -> HRESULT,
2884     fn SetPropertyString(
2885         Name: BSTR,
2886         Value: BSTR,
2887         Supported: *mut VARIANT_BOOL,
2888     ) -> HRESULT,
2889     fn GetPropertyString(
2890         Name: BSTR,
2891         Value: *mut BSTR,
2892         Supported: *mut VARIANT_BOOL,
2893     ) -> HRESULT,
2894     fn IsUISupported(
2895         TypeOfUI: BSTR,
2896         ExtraData: *const VARIANT,
2897         Supported: *mut VARIANT_BOOL,
2898     ) -> HRESULT,
2899     fn DisplayUI(
2900         hWndParent: c_long,
2901         Title: BSTR,
2902         TypeOfUI: BSTR,
2903         ExtraData: *const VARIANT,
2904     ) -> HRESULT,
2905     fn GetRecognizers(
2906         RequiredAttributes: BSTR,
2907         OptionalAttributes: BSTR,
2908         ObjectTokens: *mut *mut ISpeechObjectTokens,
2909     ) -> HRESULT,
2910     fn GetAudioInputs(
2911         RequiredAttributes: BSTR,
2912         OptionalAttributes: BSTR,
2913         ObjectTokens: *mut *mut ISpeechObjectTokens,
2914     ) -> HRESULT,
2915     fn GetProfiles(
2916         RequiredAttributes: BSTR,
2917         OptionalAttributes: BSTR,
2918         ObjectTokens: *mut *mut ISpeechObjectTokens,
2919     ) -> HRESULT,
2920 }}
2921 RIDL!{#[uuid(0xbff9e781, 0x53ec, 0x484e, 0xbb, 0x8a, 0x0e, 0x1b, 0x55, 0x51, 0xe3, 0x5c)]
2922 interface ISpeechRecognizerStatus(ISpeechRecognizerStatusVtbl): IDispatch(IDispatchVtbl) {
2923     fn get_AudioStatus(
2924         AudioStatus: *mut *mut ISpeechAudioStatus,
2925     ) -> HRESULT,
2926     fn get_CurrentStreamPosition(
2927         pCurrentStreamPos: *mut VARIANT,
2928     ) -> HRESULT,
2929     fn get_CurrentStreamNumber(
2930         StreamNumber: *mut c_long,
2931     ) -> HRESULT,
2932     fn get_NumberOfActiveRules(
2933         NumberOfActiveRules: *mut c_long,
2934     ) -> HRESULT,
2935     fn get_ClsidEngine(
2936         ClsidEngine: *mut BSTR,
2937     ) -> HRESULT,
2938     fn get_SupportedLanguages(
2939         SupportedLanguages: *mut VARIANT,
2940     ) -> HRESULT,
2941 }}
2942 RIDL!{#[uuid(0x580aa49d, 0x7e1e, 0x4809, 0xb8, 0xe2, 0x57, 0xda, 0x80, 0x61, 0x04, 0xb8)]
2943 interface ISpeechRecoContext(ISpeechRecoContextVtbl): IDispatch(IDispatchVtbl) {
2944     fn get_Recognizer(
2945         Recognizer: *mut *mut ISpeechRecognizer,
2946     ) -> HRESULT,
2947     fn get_AudioInputInterferenceStatus(
2948         Interference: *mut SpeechInterference,
2949     ) -> HRESULT,
2950     fn get_RequestedUIType(
2951         UIType: *mut BSTR,
2952     ) -> HRESULT,
2953     fn putref_Voice(
2954         Voice: *mut ISpeechVoice,
2955     ) -> HRESULT,
2956     fn get_Voice(
2957         Voice: *mut *mut ISpeechVoice,
2958     ) -> HRESULT,
2959     fn put_AllowVoiceFormatMatchingOnNextSet(
2960         Allow: VARIANT_BOOL,
2961     ) -> HRESULT,
2962     fn get_AllowVoiceFormatMatchingOnNextSet(
2963         Allow: *mut VARIANT_BOOL,
2964     ) -> HRESULT,
2965     fn put_VoicePurgeEvent(
2966         EventInterest: SpeechRecoEvents,
2967     ) -> HRESULT,
2968     fn get_VoicePurgeEvent(
2969         EventInterest: *mut SpeechRecoEvents,
2970     ) -> HRESULT,
2971     fn put_EventInterests(
2972         EventInterest: SpeechRecoEvents,
2973     ) -> HRESULT,
2974     fn get_EventInterests(
2975         EventInterest: *mut SpeechRecoEvents,
2976     ) -> HRESULT,
2977     fn put_CmdMaxAlternates(
2978         MaxAlternates: c_long,
2979     ) -> HRESULT,
2980     fn get_CmdMaxAlternates(
2981         MaxAlternates: *mut c_long,
2982     ) -> HRESULT,
2983     fn put_State(
2984         State: SpeechRecoContextState,
2985     ) -> HRESULT,
2986     fn get_State(
2987         State: *mut SpeechRecoContextState,
2988     ) -> HRESULT,
2989     fn put_RetainedAudio(
2990         Option: SpeechRetainedAudioOptions,
2991     ) -> HRESULT,
2992     fn get_RetainedAudio(
2993         Option: *mut SpeechRetainedAudioOptions,
2994     ) -> HRESULT,
2995     fn putref_RetainedAudioFormat(
2996         Format: *mut ISpeechAudioFormat,
2997     ) -> HRESULT,
2998     fn get_RetainedAudioFormat(
2999         Format: *mut *mut ISpeechAudioFormat,
3000     ) -> HRESULT,
3001     fn Pause() -> HRESULT,
3002     fn Resume() -> HRESULT,
3003     fn CreateGrammar(
3004         GrammarId: VARIANT,
3005         Grammar: *mut *mut ISpeechRecoGrammar,
3006     ) -> HRESULT,
3007     fn CreateResultFromMemory(
3008         ResultBlock: *mut VARIANT,
3009         Result: *mut *mut ISpeechRecoResult,
3010     ) -> HRESULT,
3011     fn Bookmark(
3012         Options: SpeechBookmarkOptions,
3013         StreamPos: VARIANT,
3014         BookmarkId: VARIANT,
3015     ) -> HRESULT,
3016     fn SetAdaptationData(
3017         AdaptationString: BSTR,
3018     ) -> HRESULT,
3019 }}
3020 RIDL!{#[uuid(0xb6d6f79f, 0x2158, 0x4e50, 0xb5, 0xbc, 0x9a, 0x9c, 0xcd, 0x85, 0x2a, 0x09)]
3021 interface ISpeechRecoGrammar(ISpeechRecoGrammarVtbl): IDispatch(IDispatchVtbl) {
3022     fn get_Id(
3023         Id: *mut VARIANT,
3024     ) -> HRESULT,
3025     fn get_RecoContext(
3026         RecoContext: *mut *mut ISpeechRecoContext,
3027     ) -> HRESULT,
3028     fn put_State(
3029         State: SpeechGrammarState,
3030     ) -> HRESULT,
3031     fn get_State(
3032         State: *mut SpeechGrammarState,
3033     ) -> HRESULT,
3034     fn get_Rules(
3035         Rules: *mut *mut ISpeechGrammarRules,
3036     ) -> HRESULT,
3037     fn Reset(
3038         NewLanguage: SpeechLanguageId,
3039     ) -> HRESULT,
3040     fn CmdLoadFromFile(
3041         FileName: BSTR,
3042         LoadOption: SpeechLoadOption,
3043     ) -> HRESULT,
3044     fn CmdLoadFromObject(
3045         ClassId: BSTR,
3046         GrammarName: BSTR,
3047         LoadOption: SpeechLoadOption,
3048     ) -> HRESULT,
3049     fn CmdLoadFromResource(
3050         hModule: c_long,
3051         ResourceName: VARIANT,
3052         ResourceType: VARIANT,
3053         LanguageId: SpeechLanguageId,
3054         LoadOption: SpeechLoadOption,
3055     ) -> HRESULT,
3056     fn CmdLoadFromMemory(
3057         GrammarData: VARIANT,
3058         LoadOption: SpeechLoadOption,
3059     ) -> HRESULT,
3060     fn CmdLoadFromProprietaryGrammar(
3061         ProprietaryGuid: BSTR,
3062         PriorietaryString: BSTR,
3063         ProprietaryData: VARIANT,
3064         LoadOption: SpeechLoadOption,
3065     ) -> HRESULT,
3066     fn CmdSetRuleState(
3067         Name: BSTR,
3068         State: SpeechRuleState,
3069     ) -> HRESULT,
3070     fn CmdSetRuleIdState(
3071         RuleId: c_long,
3072         State: SpeechRuleState,
3073     ) -> HRESULT,
3074     fn DictationLoad(
3075         TopicName: BSTR,
3076         LoadOption: SpeechLoadOption,
3077     ) -> HRESULT,
3078     fn DictationUnload() -> HRESULT,
3079     fn DictationSetState(
3080         State: SpeechRuleState,
3081     ) -> HRESULT,
3082     fn SetWordSequenceData(
3083         Text: BSTR,
3084         TextLength: c_long,
3085         Info: *mut ISpeechTextSelectionInformation,
3086     ) -> HRESULT,
3087     fn SetTextSelection(
3088         Info: *mut ISpeechTextSelectionInformation,
3089     ) -> HRESULT,
3090     fn IsPronounceable(
3091         Word: BSTR,
3092         WordPronounceable: *mut SpeechWordPronounceable,
3093     ) -> HRESULT,
3094 }}
3095 RIDL!{#[uuid(0x7b8fcb42, 0x0e9d, 0x4f00, 0xa0, 0x48, 0x7b, 0x04, 0xd6, 0x17, 0x9d, 0x3d)]
3096 interface _ISpeechRecoContextEvents(_ISpeechRecoContextEventsVtbl): IDispatch(IDispatchVtbl) {}}
3097 RIDL!{#[uuid(0xafe719cf, 0x5dd1, 0x44f2, 0x99, 0x9c, 0x7a, 0x39, 0x9f, 0x1c, 0xfc, 0xcc)]
3098 interface ISpeechGrammarRule(ISpeechGrammarRuleVtbl): IDispatch(IDispatchVtbl) {
3099     fn get_Attributes(
3100         Attributes: *mut SpeechRuleAttributes,
3101     ) -> HRESULT,
3102     fn get_InitialState(
3103         State: *mut *mut ISpeechGrammarRuleState,
3104     ) -> HRESULT,
3105     fn get_Name(
3106         Name: *mut BSTR,
3107     ) -> HRESULT,
3108     fn get_Id(
3109         Id: *mut c_long,
3110     ) -> HRESULT,
3111     fn Clear() -> HRESULT,
3112     fn AddResource(
3113         ResourceName: BSTR,
3114         ResourceValue: BSTR,
3115     ) -> HRESULT,
3116     fn AddState(
3117         State: *mut *mut ISpeechGrammarRuleState,
3118     ) -> HRESULT,
3119 }}
3120 RIDL!{#[uuid(0x6ffa3b44, 0xfc2d, 0x40d1, 0x8a, 0xfc, 0x32, 0x91, 0x1c, 0x7f, 0x1a, 0xd1)]
3121 interface ISpeechGrammarRules(ISpeechGrammarRulesVtbl): IDispatch(IDispatchVtbl) {
3122     fn get_Count(
3123         Count: *mut c_long,
3124     ) -> HRESULT,
3125     fn FindRule(
3126         RuleNameOrId: VARIANT,
3127         Rule: *mut *mut ISpeechGrammarRule,
3128     ) -> HRESULT,
3129     fn Item(
3130         Index: c_long,
3131         Rule: *mut *mut ISpeechGrammarRule,
3132     ) -> HRESULT,
3133     fn get__NewEnum(
3134         EnumVARIANT: *mut *mut IUnknown,
3135     ) -> HRESULT,
3136     fn get_Dynamic(
3137         Dynamic: *mut VARIANT_BOOL,
3138     ) -> HRESULT,
3139     fn Add(
3140         RuleName: BSTR,
3141         Attributes: SpeechRuleAttributes,
3142         RuleId: c_long,
3143         Rule: *mut *mut ISpeechGrammarRule,
3144     ) -> HRESULT,
3145     fn Commit() -> HRESULT,
3146     fn CommitAndSave(
3147         ErrorText: *mut BSTR,
3148         SaveStream: *mut VARIANT,
3149     ) -> HRESULT,
3150 }}
3151 RIDL!{#[uuid(0xd4286f2c, 0xee67, 0x45ae, 0xb9, 0x28, 0x28, 0xd6, 0x95, 0x36, 0x2e, 0xda)]
3152 interface ISpeechGrammarRuleState(ISpeechGrammarRuleStateVtbl): IDispatch(IDispatchVtbl) {
3153     fn get_Rule(
3154         Rule: *mut *mut ISpeechGrammarRule,
3155     ) -> HRESULT,
3156     fn get_Transitions(
3157         Transitions: *mut *mut ISpeechGrammarRuleStateTransitions,
3158     ) -> HRESULT,
3159     fn AddWordTransition(
3160         DestState: *mut ISpeechGrammarRuleState,
3161         Words: BSTR,
3162         Separators: BSTR,
3163         Type: SpeechGrammarWordType,
3164         PropertyName: BSTR,
3165         PropertyId: c_long,
3166         PropertyValue: *mut VARIANT,
3167         Weight: c_float,
3168     ) -> HRESULT,
3169     fn AddRuleTransition(
3170         DestinationState: *mut ISpeechGrammarRuleState,
3171         Rule: *mut ISpeechGrammarRule,
3172         PropertyName: BSTR,
3173         PropertyId: c_long,
3174         PropertyValue: *mut VARIANT,
3175         Weight: c_float,
3176     ) -> HRESULT,
3177     fn AddSpecialTransition(
3178         DestinationState: *mut ISpeechGrammarRuleState,
3179         Type: SpeechSpecialTransitionType,
3180         PropertyName: BSTR,
3181         PropertyId: c_long,
3182         PropertyValue: *mut VARIANT,
3183         Weight: c_float,
3184     ) -> HRESULT,
3185 }}
3186 RIDL!{#[uuid(0xcafd1db1, 0x41d1, 0x4a06, 0x98, 0x63, 0xe2, 0xe8, 0x1d, 0xa1, 0x7a, 0x9a)]
3187 interface ISpeechGrammarRuleStateTransition(ISpeechGrammarRuleStateTransitionVtbl):
3188     IDispatch(IDispatchVtbl) {
3189     fn get_Type(
3190         Type: *mut SpeechGrammarRuleStateTransitionType,
3191     ) -> HRESULT,
3192     fn get_Text(
3193         Text: *mut BSTR,
3194     ) -> HRESULT,
3195     fn get_Rule(
3196         Rule: *mut *mut ISpeechGrammarRule,
3197     ) -> HRESULT,
3198     fn get_Weight(
3199         Weight: *mut VARIANT,
3200     ) -> HRESULT,
3201     fn get_PropertyName(
3202         PropertyName: *mut BSTR,
3203     ) -> HRESULT,
3204     fn get_PropertyId(
3205         PropertyId: *mut c_long,
3206     ) -> HRESULT,
3207     fn get_PropertyValue(
3208         PropertyValue: *mut VARIANT,
3209     ) -> HRESULT,
3210     fn get_NextState(
3211         NextState: *mut *mut ISpeechGrammarRuleState,
3212     ) -> HRESULT,
3213 }}
3214 RIDL!{#[uuid(0xeabce657, 0x75bc, 0x44a2, 0xaa, 0x7f, 0xc5, 0x64, 0x76, 0x74, 0x29, 0x63)]
3215 interface ISpeechGrammarRuleStateTransitions(ISpeechGrammarRuleStateTransitionsVtbl):
3216     IDispatch(IDispatchVtbl) {
3217     fn get_Count(
3218         Count: *mut c_long,
3219     ) -> HRESULT,
3220     fn Item(
3221         Index: c_long,
3222         Transition: *mut *mut ISpeechGrammarRuleStateTransition,
3223     ) -> HRESULT,
3224     fn get__NewEnum(
3225         EnumVARIANT: *mut *mut IUnknown,
3226     ) -> HRESULT,
3227 }}
3228 RIDL!{#[uuid(0x3b9c7e7a, 0x6eee, 0x4ded, 0x90, 0x92, 0x11, 0x65, 0x72, 0x79, 0xad, 0xbe)]
3229 interface ISpeechTextSelectionInformation(ISpeechTextSelectionInformationVtbl):
3230     IDispatch(IDispatchVtbl) {
3231     fn put_ActiveOffset(
3232         ActiveOffset: c_long,
3233     ) -> HRESULT,
3234     fn get_ActiveOffset(
3235         ActiveOffset: *mut c_long,
3236     ) -> HRESULT,
3237     fn put_ActiveLength(
3238         ActiveLength: c_long,
3239     ) -> HRESULT,
3240     fn get_ActiveLength(
3241         ActiveLength: *mut c_long,
3242     ) -> HRESULT,
3243     fn put_SelectionOffset(
3244         SelectionOffset: c_long,
3245     ) -> HRESULT,
3246     fn get_SelectionOffset(
3247         SelectionOffset: *mut c_long,
3248     ) -> HRESULT,
3249     fn put_SelectionLength(
3250         SelectionLength: c_long,
3251     ) -> HRESULT,
3252     fn get_SelectionLength(
3253         SelectionLength: *mut c_long,
3254     ) -> HRESULT,
3255 }}
3256 RIDL!{#[uuid(0xed2879cf, 0xced9, 0x4ee6, 0xa5, 0x34, 0xde, 0x01, 0x91, 0xd5, 0x46, 0x8d)]
3257 interface ISpeechRecoResult(ISpeechRecoResultVtbl): IDispatch(IDispatchVtbl) {
3258     fn get_RecoContext(
3259         RecoContext: *mut *mut ISpeechRecoContext,
3260     ) -> HRESULT,
3261     fn get_Times(
3262         Times: *mut *mut ISpeechRecoResultTimes,
3263     ) -> HRESULT,
3264     fn putref_AudioFormat(
3265         Format: *mut ISpeechAudioFormat,
3266     ) -> HRESULT,
3267     fn get_AudioFormat(
3268         Format: *mut *mut ISpeechAudioFormat,
3269     ) -> HRESULT,
3270     fn get_PhraseInfo(
3271         PhraseInfo: *mut *mut ISpeechPhraseInfo,
3272     ) -> HRESULT,
3273     fn Alternates(
3274         RequestCount: c_long,
3275         StartElement: c_long,
3276         Elements: c_long,
3277         Alternates: *mut *mut ISpeechPhraseAlternates,
3278     ) -> HRESULT,
3279     fn Audio(
3280         StartElement: c_long,
3281         Elements: c_long,
3282         Stream: *mut *mut ISpeechMemoryStream,
3283     ) -> HRESULT,
3284     fn SpeakAudio(
3285         StartElement: c_long,
3286         Elements: c_long,
3287         Flags: SpeechVoiceSpeakFlags,
3288         StreamNumber: *mut c_long,
3289     ) -> HRESULT,
3290     fn SaveToMemory(
3291         ResultBlock: *mut VARIANT,
3292     ) -> HRESULT,
3293     fn DiscardResultInfo(
3294         ValueTypes: SpeechDiscardType,
3295     ) -> HRESULT,
3296 }}
3297 RIDL!{#[uuid(0x62b3b8fb, 0xf6e7, 0x41be, 0xbd, 0xcb, 0x05, 0x6b, 0x1c, 0x29, 0xef, 0xc0)]
3298 interface ISpeechRecoResultTimes(ISpeechRecoResultTimesVtbl): IDispatch(IDispatchVtbl) {
3299     fn get_StreamTime(
3300         Time: *mut VARIANT,
3301     ) -> HRESULT,
3302     fn get_Length(
3303         Length: *mut VARIANT,
3304     ) -> HRESULT,
3305     fn get_TickCount(
3306         TickCount: *mut c_long,
3307     ) -> HRESULT,
3308     fn get_OffsetFromStart(
3309         OffsetFromStart: *mut VARIANT,
3310     ) -> HRESULT,
3311 }}
3312 RIDL!{#[uuid(0x27864a2a, 0x2b9f, 0x4cb8, 0x92, 0xd3, 0x0d, 0x27, 0x22, 0xfd, 0x1e, 0x73)]
3313 interface ISpeechPhraseAlternate(ISpeechPhraseAlternateVtbl): IDispatch(IDispatchVtbl) {
3314     fn get_RecoResult(
3315         RecoResult: *mut *mut ISpeechRecoResult,
3316     ) -> HRESULT,
3317     fn get_StartElementInResult(
3318         StartElement: *mut c_long,
3319     ) -> HRESULT,
3320     fn get_NumberOfElementsInResult(
3321         NumberOfElements: *mut c_long,
3322     ) -> HRESULT,
3323     fn get_PhraseInfo(
3324         PhraseInfo: *mut *mut ISpeechPhraseInfo,
3325     ) -> HRESULT,
3326     fn Commit() -> HRESULT,
3327 }}
3328 RIDL!{#[uuid(0xb238b6d5, 0xf276, 0x4c3d, 0xa6, 0xc1, 0x29, 0x74, 0x80, 0x1c, 0x3c, 0xc2)]
3329 interface ISpeechPhraseAlternates(ISpeechPhraseAlternatesVtbl): IDispatch(IDispatchVtbl) {
3330     fn get_Count(
3331         Count: *mut c_long,
3332     ) -> HRESULT,
3333     fn Item(
3334         Index: c_long,
3335         PhraseAlternate: *mut *mut ISpeechPhraseAlternate,
3336     ) -> HRESULT,
3337     fn get__NewEnum(
3338         EnumVARIANT: *mut *mut IUnknown,
3339     ) -> HRESULT,
3340 }}
3341 RIDL!{#[uuid(0x961559cf, 0x4e67, 0x4662, 0x8b, 0xf0, 0xd9, 0x3f, 0x1f, 0xcd, 0x61, 0xb3)]
3342 interface ISpeechPhraseInfo(ISpeechPhraseInfoVtbl): IDispatch(IDispatchVtbl) {
3343     fn get_LanguageId(
3344         LanguageId: *mut c_long,
3345     ) -> HRESULT,
3346     fn get_GrammarId(
3347         GrammarId: *mut VARIANT,
3348     ) -> HRESULT,
3349     fn get_StartTime(
3350         StartTime: *mut VARIANT,
3351     ) -> HRESULT,
3352     fn get_AudioStreamPosition(
3353         AudioStreamPosition: *mut VARIANT,
3354     ) -> HRESULT,
3355     fn get_AudioSizeBytes(
3356         pAudioSizeBytes: *mut c_long,
3357     ) -> HRESULT,
3358     fn get_RetainedSizeBytes(
3359         RetainedSizeBytes: *mut c_long,
3360     ) -> HRESULT,
3361     fn get_AudioSizeTime(
3362         AudioSizeTime: *mut c_long,
3363     ) -> HRESULT,
3364     fn get_Rule(
3365         Rule: *mut *mut ISpeechPhraseRule,
3366     ) -> HRESULT,
3367     fn get_Properties(
3368         Properties: *mut *mut ISpeechPhraseProperties,
3369     ) -> HRESULT,
3370     fn get_Elements(
3371         Elements: *mut *mut ISpeechPhraseElements,
3372     ) -> HRESULT,
3373     fn get_Replacements(
3374         Replacements: *mut *mut ISpeechPhraseReplacements,
3375     ) -> HRESULT,
3376     fn get_EngineId(
3377         EngineIdGuid: *mut BSTR,
3378     ) -> HRESULT,
3379     fn get_EnginePrivateData(
3380         PrivateData: *mut VARIANT,
3381     ) -> HRESULT,
3382     fn SaveToMemory(
3383         PhraseBlock: *mut VARIANT,
3384     ) -> HRESULT,
3385     fn GetText(
3386         StartElement: c_long,
3387         Elements: c_long,
3388         UseReplacements: VARIANT_BOOL,
3389         Text: *mut BSTR,
3390     ) -> HRESULT,
3391     fn GetDisplayAttributes(
3392         StartElement: c_long,
3393         Elements: c_long,
3394         UseReplacements: VARIANT_BOOL,
3395         DisplayAttributes: *mut SpeechDisplayAttributes,
3396     ) -> HRESULT,
3397 }}
3398 RIDL!{#[uuid(0xe6176f96, 0xe373, 0x4801, 0xb2, 0x23, 0x3b, 0x62, 0xc0, 0x68, 0xc0, 0xb4)]
3399 interface ISpeechPhraseElement(ISpeechPhraseElementVtbl): IDispatch(IDispatchVtbl) {
3400     fn get_AudioTimeOffset(
3401         AudioTimeOffset: *mut c_long,
3402     ) -> HRESULT,
3403     fn get_AudioSizeTime(
3404         AudioSizeTime: *mut c_long,
3405     ) -> HRESULT,
3406     fn get_AudioStreamOffset(
3407         AudioStreamOffset: *mut c_long,
3408     ) -> HRESULT,
3409     fn get_AudioSizeBytes(
3410         AudioSizeBytes: *mut c_long,
3411     ) -> HRESULT,
3412     fn get_RetainedStreamOffset(
3413         RetainedStreamOffset: *mut c_long,
3414     ) -> HRESULT,
3415     fn get_RetainedSizeBytes(
3416         RetainedSizeBytes: *mut c_long,
3417     ) -> HRESULT,
3418     fn get_DisplayText(
3419         DisplayText: *mut BSTR,
3420     ) -> HRESULT,
3421     fn get_LexicalForm(
3422         LexicalForm: *mut BSTR,
3423     ) -> HRESULT,
3424     fn get_Pronunciation(
3425         Pronunciation: *mut VARIANT,
3426     ) -> HRESULT,
3427     fn get_DisplayAttributes(
3428         DisplayAttributes: *mut SpeechDisplayAttributes,
3429     ) -> HRESULT,
3430     fn get_RequiredConfidence(
3431         RequiredConfidence: *mut SpeechEngineConfidence,
3432     ) -> HRESULT,
3433     fn get_ActualConfidence(
3434         ActualConfidence: *mut SpeechEngineConfidence,
3435     ) -> HRESULT,
3436     fn get_EngineConfidence(
3437         EngineConfident: *mut c_float,
3438     ) -> HRESULT,
3439 }}
3440 RIDL!{#[uuid(0x0626b328, 0x3478, 0x467d, 0xa0, 0xb3, 0xd0, 0x85, 0x3b, 0x93, 0xdd, 0xa3)]
3441 interface ISpeechPhraseElements(ISpeechPhraseElementsVtbl): IDispatch(IDispatchVtbl) {
3442     fn get_Count(
3443         Count: *mut c_long,
3444     ) -> HRESULT,
3445     fn Item(
3446         Index: c_long,
3447         Element: *mut *mut ISpeechPhraseElement,
3448     ) -> HRESULT,
3449     fn get__NewEnum(
3450         EnumVARIANT: *mut *mut IUnknown,
3451     ) -> HRESULT,
3452 }}
3453 RIDL!{#[uuid(0x2890a410, 0x53a7, 0x4fb5, 0x94, 0xec, 0x06, 0xd4, 0x99, 0x8e, 0x3d, 0x02)]
3454 interface ISpeechPhraseReplacement(ISpeechPhraseReplacementVtbl): IDispatch(IDispatchVtbl) {
3455     fn get_DisplayAttributes(
3456         DisplayAttributes: *mut SpeechDisplayAttributes,
3457     ) -> HRESULT,
3458     fn get_Text(
3459         Text: *mut BSTR,
3460     ) -> HRESULT,
3461     fn get_FirstElement(
3462         FirstElement: *mut c_long,
3463     ) -> HRESULT,
3464     fn get_NumberOfElements(
3465         NumberOfElements: *mut c_long,
3466     ) -> HRESULT,
3467 }}
3468 RIDL!{#[uuid(0x38bc662f, 0x2257, 0x4525, 0x95, 0x9e, 0x20, 0x69, 0xd2, 0x59, 0x6c, 0x05)]
3469 interface ISpeechPhraseReplacements(ISpeechPhraseReplacementsVtbl): IDispatch(IDispatchVtbl) {
3470     fn get_Count(
3471         Count: *mut c_long,
3472     ) -> HRESULT,
3473     fn Item(
3474         Index: c_long,
3475         Reps: *mut *mut ISpeechPhraseReplacement,
3476     ) -> HRESULT,
3477     fn get__NewEnum(
3478         EnumVARIANT: *mut *mut IUnknown,
3479     ) -> HRESULT,
3480 }}
3481 RIDL!{#[uuid(0xce563d48, 0x961e, 0x4732, 0xa2, 0xe1, 0x37, 0x8a, 0x42, 0xb4, 0x30, 0xbe)]
3482 interface ISpeechPhraseProperty(ISpeechPhrasePropertyVtbl): IDispatch(IDispatchVtbl) {
3483     fn get_Name(
3484         Name: *mut BSTR,
3485     ) -> HRESULT,
3486     fn get_Id(
3487         Id: *mut c_long,
3488     ) -> HRESULT,
3489     fn get_Value(
3490         Value: *mut VARIANT,
3491     ) -> HRESULT,
3492     fn get_FirstElement(
3493         FirstElement: *mut c_long,
3494     ) -> HRESULT,
3495     fn get_NumberOfElements(
3496         NumberOfElements: *mut c_long,
3497     ) -> HRESULT,
3498     fn get_EngineConfidence(
3499         Confidence: *mut c_float,
3500     ) -> HRESULT,
3501     fn get_Confidence(
3502         Confidence: *mut SpeechEngineConfidence,
3503     ) -> HRESULT,
3504     fn get_Parent(
3505         ParentProperty: *mut *mut ISpeechPhraseProperty,
3506     ) -> HRESULT,
3507     fn get_Children(
3508         Children: *mut *mut ISpeechPhraseProperties,
3509     ) -> HRESULT,
3510 }}
3511 RIDL!{#[uuid(0x08166b47, 0x102e, 0x4b23, 0xa5, 0x99, 0xbd, 0xb9, 0x8d, 0xbf, 0xd1, 0xf4)]
3512 interface ISpeechPhraseProperties(ISpeechPhrasePropertiesVtbl): IDispatch(IDispatchVtbl) {
3513     fn get_Count(
3514         Count: *mut c_long,
3515     ) -> HRESULT,
3516     fn Item(
3517         Index: c_long,
3518         Property: *mut *mut ISpeechPhraseProperty,
3519     ) -> HRESULT,
3520     fn get__NewEnum(
3521         EnumVARIANT: *mut *mut IUnknown,
3522     ) -> HRESULT,
3523 }}
3524 RIDL!{#[uuid(0xa7bfe112, 0xa4a0, 0x48d9, 0xb6, 0x02, 0xc3, 0x13, 0x84, 0x3f, 0x69, 0x64)]
3525 interface ISpeechPhraseRule(ISpeechPhraseRuleVtbl): IDispatch(IDispatchVtbl) {
3526     fn get_Name(
3527         Name: *mut BSTR,
3528     ) -> HRESULT,
3529     fn get_Id(
3530         Id: *mut c_long,
3531     ) -> HRESULT,
3532     fn get_FirstElement(
3533         FirstElement: *mut c_long,
3534     ) -> HRESULT,
3535     fn get_NumberOfElements(
3536         NumberOfElements: *mut c_long,
3537     ) -> HRESULT,
3538     fn get_Parent(
3539         Parent: *mut *mut ISpeechPhraseRule,
3540     ) -> HRESULT,
3541     fn get_Children(
3542         Children: *mut *mut ISpeechPhraseRules,
3543     ) -> HRESULT,
3544     fn get_Confidence(
3545         ActualConfidence: *mut SpeechEngineConfidence,
3546     ) -> HRESULT,
3547     fn get_EngineConfidence(
3548         Confidence: *mut c_float,
3549     ) -> HRESULT,
3550 }}
3551 RIDL!{#[uuid(0x9047d593, 0x01dd, 0x4b72, 0x81, 0xa3, 0xe4, 0xa0, 0xca, 0x69, 0xf4, 0x07)]
3552 interface ISpeechPhraseRules(ISpeechPhraseRulesVtbl): IDispatch(IDispatchVtbl) {
3553     fn get_Count(
3554         Count: *mut c_long,
3555     ) -> HRESULT,
3556     fn Item(
3557         Index: c_long,
3558         Rule: *mut *mut ISpeechPhraseRule,
3559     ) -> HRESULT,
3560     fn get__NewEnum(
3561         EnumVARIANT: *mut *mut IUnknown,
3562     ) -> HRESULT,
3563 }}
3564 RIDL!{#[uuid(0x3da7627a, 0xc7ae, 0x4b23, 0x87, 0x08, 0x63, 0x8c, 0x50, 0x36, 0x2c, 0x25)]
3565 interface ISpeechLexicon(ISpeechLexiconVtbl): IDispatch(IDispatchVtbl) {
3566     fn get_GenerationId(
3567         GenerationId: *mut c_long,
3568     ) -> HRESULT,
3569     fn GetWords(
3570         Flags: SpeechLexiconType,
3571         GenerationID: *mut c_long,
3572         Words: *mut *mut ISpeechLexiconWords,
3573     ) -> HRESULT,
3574     fn AddPronunciation(
3575         bstrWord: BSTR,
3576         LangId: SpeechLanguageId,
3577         PartOfSpeech: SpeechPartOfSpeech,
3578         bstrPronunciation: BSTR,
3579     ) -> HRESULT,
3580     fn AddPronunciationByPhoneIds(
3581         bstrWord: BSTR,
3582         LangId: SpeechLanguageId,
3583         PartOfSpeech: SpeechPartOfSpeech,
3584         PhoneIds: *mut VARIANT,
3585     ) -> HRESULT,
3586     fn RemovePronunciation(
3587         bstrWord: BSTR,
3588         LangId: SpeechLanguageId,
3589         PartOfSpeech: SpeechPartOfSpeech,
3590         bstrPronunciation: BSTR,
3591     ) -> HRESULT,
3592     fn RemovePronunciationByPhoneIds(
3593         bstrWord: BSTR,
3594         LangId: SpeechLanguageId,
3595         PartOfSpeech: SpeechPartOfSpeech,
3596         PhoneIds: *mut VARIANT,
3597     ) -> HRESULT,
3598     fn GetPronunciations(
3599         bstrWord: BSTR,
3600         LangId: SpeechLanguageId,
3601         TypeFlags: SpeechLexiconType,
3602         ppPronunciations: *mut *mut ISpeechLexiconPronunciations,
3603     ) -> HRESULT,
3604     fn GetGenerationChange(
3605         GenerationID: *mut c_long,
3606         ppWords: *mut *mut ISpeechLexiconWords,
3607     ) -> HRESULT,
3608 }}
3609 RIDL!{#[uuid(0x8d199862, 0x415e, 0x47d5, 0xac, 0x4f, 0xfa, 0xa6, 0x08, 0xb4, 0x24, 0xe6)]
3610 interface ISpeechLexiconWords(ISpeechLexiconWordsVtbl): IDispatch(IDispatchVtbl) {
3611     fn get_Count(
3612         Count: *mut c_long,
3613     ) -> HRESULT,
3614     fn Item(
3615         Index: c_long,
3616         Word: *mut *mut ISpeechLexiconWord,
3617     ) -> HRESULT,
3618     fn get__NewEnum(
3619         EnumVARIANT: *mut *mut IUnknown,
3620     ) -> HRESULT,
3621 }}
3622 RIDL!{#[uuid(0x4e5b933c, 0xc9be, 0x48ed, 0x88, 0x42, 0x1e, 0xe5, 0x1b, 0xb1, 0xd4, 0xff)]
3623 interface ISpeechLexiconWord(ISpeechLexiconWordVtbl): IDispatch(IDispatchVtbl) {
3624     fn get_LangId(
3625         LangId: *mut SpeechLanguageId,
3626     ) -> HRESULT,
3627     fn get_Type(
3628         WordType: *mut SpeechWordType,
3629     ) -> HRESULT,
3630     fn get_Word(
3631         Word: *mut BSTR,
3632     ) -> HRESULT,
3633     fn get_Pronunciations(
3634         Pronunciations: *mut *mut ISpeechLexiconPronunciations,
3635     ) -> HRESULT,
3636 }}
3637 RIDL!{#[uuid(0x72829128, 0x5682, 0x4704, 0xa0, 0xd4, 0x3e, 0x2b, 0xb6, 0xf2, 0xea, 0xd3)]
3638 interface ISpeechLexiconPronunciations(ISpeechLexiconPronunciationsVtbl):
3639     IDispatch(IDispatchVtbl) {
3640     fn get_Count(
3641         Count: *mut c_long,
3642     ) -> HRESULT,
3643     fn Item(
3644         Index: c_long,
3645         Pronunciation: *mut *mut ISpeechLexiconPronunciation,
3646     ) -> HRESULT,
3647     fn get__NewEnum(
3648         EnumVARIANT: *mut *mut IUnknown,
3649     ) -> HRESULT,
3650 }}
3651 RIDL!{#[uuid(0x95252c5d, 0x9e43, 0x4f4a, 0x98, 0x99, 0x48, 0xee, 0x73, 0x35, 0x2f, 0x9f)]
3652 interface ISpeechLexiconPronunciation(ISpeechLexiconPronunciationVtbl): IDispatch(IDispatchVtbl) {
3653     fn get_Type(
3654         LexiconType: *mut SpeechLexiconType,
3655     ) -> HRESULT,
3656     fn get_LangId(
3657         LangId: *mut SpeechLanguageId,
3658     ) -> HRESULT,
3659     fn get_PartOfSpeech(
3660         PartOfSpeech: *mut SpeechPartOfSpeech,
3661     ) -> HRESULT,
3662     fn get_PhoneIds(
3663         PhoneIds: *mut VARIANT,
3664     ) -> HRESULT,
3665     fn get_Symbolic(
3666         Symbolic: *mut BSTR,
3667     ) -> HRESULT,
3668 }}
3669 pub const Speech_Default_Weight: c_float = DEFAULT_WEIGHT;
3670 pub const Speech_Max_Word_Length: LONG = SP_MAX_WORD_LENGTH as i32;
3671 pub const Speech_Max_Pron_Length: LONG = SP_MAX_PRON_LENGTH as i32;
3672 pub const Speech_StreamPos_Asap: LONG = SP_STREAMPOS_ASAP as i32;
3673 pub const Speech_StreamPos_RealTime: LONG = SP_STREAMPOS_REALTIME as i32;
3674 pub const SpeechAllElements: LONG = SPPR_ALL_ELEMENTS as i32;
3675 RIDL!{#[uuid(0x3b151836, 0xdf3a, 0x4e0a, 0x84, 0x6c, 0xd2, 0xad, 0xc9, 0x33, 0x43, 0x33)]
3676 interface ISpeechPhraseInfoBuilder(ISpeechPhraseInfoBuilderVtbl): IDispatch(IDispatchVtbl) {
3677     fn RestorePhraseFromMemory(
3678         PhraseInMemory: *mut VARIANT,
3679         PhraseInfo: *mut *mut ISpeechPhraseInfo,
3680     ) -> HRESULT,
3681 }}
3682 RIDL!{#[uuid(0xc3e4f353, 0x433f, 0x43d6, 0x89, 0xa1, 0x6a, 0x62, 0xa7, 0x05, 0x4c, 0x3d)]
3683 interface ISpeechPhoneConverter(ISpeechPhoneConverterVtbl): IDispatch(IDispatchVtbl) {
3684     fn get_LanguageId(
3685         LanguageId: *mut SpeechLanguageId,
3686     ) -> HRESULT,
3687     fn put_LanguageId(
3688         LanguageId: SpeechLanguageId,
3689     ) -> HRESULT,
3690     fn PhoneToId(
3691         Phonemes: BSTR,
3692         IdArray: *mut VARIANT,
3693     ) -> HRESULT,
3694     fn IdToPhone(
3695         IdArray: VARIANT,
3696         Phonemes: *mut BSTR,
3697     ) -> HRESULT,
3698 }}
3699 extern {
3700     pub static CLSID_SpNotifyTranslator: CLSID;
3701     pub static CLSID_SpObjectTokenCategory: CLSID;
3702     pub static CLSID_SpObjectToken: CLSID;
3703     pub static CLSID_SpResourceManager: CLSID;
3704     pub static CLSID_SpStreamFormatConverter: CLSID;
3705     pub static CLSID_SpMMAudioEnum: CLSID;
3706     pub static CLSID_SpMMAudioIn: CLSID;
3707     pub static CLSID_SpMMAudioOut: CLSID;
3708     pub static CLSID_SpStream: CLSID;
3709     pub static CLSID_SpVoice: CLSID;
3710     pub static CLSID_SpSharedRecoContext: CLSID;
3711     pub static CLSID_SpInprocRecognizer: CLSID;
3712     pub static CLSID_SpSharedRecognizer: CLSID;
3713     pub static CLSID_SpLexicon: CLSID;
3714     pub static CLSID_SpUnCompressedLexicon: CLSID;
3715     pub static CLSID_SpCompressedLexicon: CLSID;
3716     pub static CLSID_SpPhoneConverter: CLSID;
3717     pub static CLSID_SpNullPhoneConverter: CLSID;
3718     pub static CLSID_SpTextSelectionInformation: CLSID;
3719     pub static CLSID_SpPhraseInfoBuilder: CLSID;
3720     pub static CLSID_SpAudioFormat: CLSID;
3721     pub static CLSID_SpWaveFormatEx: CLSID;
3722     pub static CLSID_SpInProcRecoContext: CLSID;
3723     pub static CLSID_SpCustomStream: CLSID;
3724     pub static CLSID_SpFileStream: CLSID;
3725     pub static CLSID_SpMemoryStream: CLSID;
3726 }
3727