widl: Always check the runtimeclass interfaces presence.
[wine/zf.git] / include / sapi.idl
blob5120e3794506097b42354a7edb1712915856a84e
1 /*
2 * Speech API (SAPI) IDL file.
4 * Copyright (C) 2017 Huw Davies
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 import "oaidl.idl";
22 import "ocidl.idl";
24 #ifndef __WIDL__
25 #define threading(model)
26 #define progid(str)
27 #define vi_progid(str)
28 #endif
30 cpp_quote("#if 0")
31 typedef [restricted, hidden] struct WAVEFORMATEX
33 WORD wFormatTag;
34 WORD nChannels;
35 DWORD nSamplesPerSec;
36 DWORD nAvgBytesPerSec;
37 WORD nBlockAlign;
38 WORD wBitsPerSample;
39 WORD cbSize;
40 } WAVEFORMATEX;
41 cpp_quote("#else")
42 cpp_quote("#include <mmsystem.h>")
43 cpp_quote("#endif")
45 cpp_quote("#if defined(__cplusplus)")
46 cpp_quote("interface ISpNotifyCallback")
47 cpp_quote("{")
48 cpp_quote("virtual HRESULT STDMETHODCALLTYPE NotifyCallback(WPARAM wParam, LPARAM lParam) = 0;")
49 cpp_quote("};")
50 cpp_quote("#else")
51 typedef void * ISpNotifyCallback;
52 cpp_quote("#endif")
54 cpp_quote("#if 0")
55 typedef void * SPNOTIFYCALLBACK;
56 typedef void * SPSTATEHANDLE;
57 cpp_quote("#endif")
59 typedef [restricted, hidden] struct SPEVENT
61 WORD eEventId;
62 WORD elParamType;
63 ULONG ulStreamNum;
64 ULONGLONG ullAudioStreamOffset;
65 WPARAM wParam;
66 LPARAM lParam;
67 } SPEVENT;
69 cpp_quote("typedef void __stdcall SPNOTIFYCALLBACK(WPARAM wParam, LPARAM lParam);")
70 cpp_quote("DECLARE_HANDLE(SPSTATEHANDLE);")
72 const ULONG SP_MAX_LANGIDS = 20;
74 typedef [restricted, hidden] struct SPEVENTSOURCEINFO
76 ULONGLONG ullEventInterest;
77 ULONGLONG ullQueuedInterest;
78 ULONG ulCount;
79 } SPEVENTSOURCEINFO;
81 typedef [hidden] enum SPGRAMMARWORDTYPE
83 SPWT_DISPLAY,
84 SPWT_LEXICAL,
85 SPWT_PRONUNCIATION,
86 SPWT_LEXICAL_NO_SPECIAL_CHARS
87 } SPGRAMMARWORDTYPE;
89 typedef [hidden] struct tagSPPROPERTYINFO
91 const WCHAR *pszName;
92 ULONG ulId;
93 const WCHAR *pszValue;
94 VARIANT vValue;
95 } SPPROPERTYINFO;
97 typedef [hidden] enum SPDATAKEYLOCATION
99 SPDKL_DefaultLocation = 0,
100 SPDKL_CurrentUser = 1,
101 SPDKL_LocalMachine = 2,
102 SPDKL_CurrentConfig = 5
103 } SPDATAKEYLOCATION;
105 typedef [hidden] enum SPLOADOPTIONS
107 SPLO_STATIC,
108 SPLO_DYNAMIC
109 } SPLOADOPTIONS;
111 typedef [hidden] enum SPRULESTATE
113 SPRS_INACTIVE = 0,
114 SPRS_ACTIVE = 1,
115 SPRS_ACTIVE_WITH_AUTO_PAUSE = 3,
116 SPRS_ACTIVE_USER_DELIMITED = 4
117 } SPRULESTATE;
119 typedef [hidden] enum SPGRAMMARSTATE
121 SPGS_DISABLED = 0,
122 SPGS_ENABLED = 1,
123 SPGS_EXCLUSIVE = 3
124 } SPGRAMMARSTATE;
126 typedef [hidden] struct SPBINARYGRAMMAR
128 ULONG ulTotalSerializedSize;
129 } SPBINARYGRAMMAR;
131 typedef [hidden] struct tagSPTEXTSELECTIONINFO
133 ULONG ulStartActiveOffset;
134 ULONG cchActiveChars;
135 ULONG ulStartSelection;
136 ULONG cchSelection;
137 } SPTEXTSELECTIONINFO;
139 typedef [hidden] enum SPWORDPRONOUNCEABLE
141 SPWP_UNKNOWN_WORD_UNPRONOUNCEABLE,
142 SPWP_UNKNOWN_WORD_PRONOUNCEABLE,
143 SPWP_KNOWN_WORD_PRONOUNCEABLE
144 } SPWORDPRONOUNCEABLE;
146 typedef [hidden] enum SPINTERFERENCE
148 SPINTERFERENCE_NONE,
149 SPINTERFERENCE_NOISE,
150 SPINTERFERENCE_NOSIGNAL,
151 SPINTERFERENCE_TOOLOUD,
152 SPINTERFERENCE_TOOQUIET,
153 SPINTERFERENCE_TOOFAST,
154 SPINTERFERENCE_TOOSLOW
155 } SPINTERFERENCE;
157 typedef [hidden] enum SPVISEMES
159 SP_VISEME_0 = 0,
160 SP_VISEME_1,
161 SP_VISEME_2,
162 SP_VISEME_3,
163 SP_VISEME_4,
164 SP_VISEME_5,
165 SP_VISEME_6,
166 SP_VISEME_7,
167 SP_VISEME_8,
168 SP_VISEME_9,
169 SP_VISEME_10,
170 SP_VISEME_11,
171 SP_VISEME_12,
172 SP_VISEME_13,
173 SP_VISEME_14,
174 SP_VISEME_15,
175 SP_VISEME_16,
176 SP_VISEME_17,
177 SP_VISEME_18,
178 SP_VISEME_19,
179 SP_VISEME_20,
180 SP_VISEME_21,
181 } SPVISEMES;
183 typedef [hidden] enum SPEVENTENUM
185 SPEI_UNDEFINED = 0,
186 SPEI_START_INPUT_STREAM = 1,
187 SPEI_END_INPUT_STREAM = 2,
188 SPEI_VOICE_CHANGE = 3,
189 SPEI_TTS_BOOKMARK = 4,
190 SPEI_WORD_BOUNDARY = 5,
191 SPEI_PHONEME = 6,
192 SPEI_SENTENCE_BOUNDARY = 7,
193 SPEI_VISEME = 8,
194 SPEI_TTS_AUDIO_LEVEL = 9,
195 SPEI_TTS_PRIVATE = 15,
197 SPEI_MIN_TTS = 1,
198 SPEI_MAX_TTS = 15,
200 SPEI_END_SR_STREAM = 34,
201 SPEI_SOUND_START = 35,
202 SPEI_SOUND_END = 36,
203 SPEI_PHRASE_START = 37,
204 SPEI_RECOGNITION = 38,
205 SPEI_HYPOTHESIS = 39,
206 SPEI_SR_BOOKMARK = 40,
207 SPEI_PROPERTY_NUM_CHANGE = 41,
208 SPEI_PROPERTY_STRING_CHANGE = 42,
209 SPEI_FALSE_RECOGNITION = 43,
210 SPEI_INTERFERENCE = 44,
211 SPEI_REQUEST_UI = 45,
212 SPEI_RECO_STATE_CHANGE = 46,
213 SPEI_ADAPTATION = 47,
214 SPEI_START_SR_STREAM = 48,
215 SPEI_RECO_OTHER_CONTEXT = 49,
216 SPEI_SR_AUDIO_LEVEL = 50,
217 SPEI_SR_RETAINEDAUDIO = 51,
218 SPEI_SR_PRIVATE = 52,
219 SPEI_ACTIVE_CATEGORY_CHANGED = 53,
221 SPEI_MIN_SR = 34,
222 SPEI_MAX_SR = 55,
224 SPEI_RESERVED1 = 30,
225 SPEI_RESERVED2 = 33,
226 SPEI_RESERVED3 = 63
227 } SPEVENTENUM;
229 typedef [hidden] enum SPCONTEXTSTATE
231 SPCS_DISABLED = 0,
232 SPCS_ENABLED = 1,
233 } SPCONTEXTSTATE;
235 typedef [hidden] enum SPVPRIORITY
237 SPVPRI_NORMAL = 0,
238 SPVPRI_ALERT = 1,
239 SPVPRI_OVER = 2
240 } SPVPRIORITY;
242 typedef [hidden] enum SPRECOSTATE
244 SPRST_INACTIVE,
245 SPRST_ACTIVE,
246 SPRST_ACTIVE_ALWAYS,
247 SPRST_INACTIVE_WITH_PURGE,
248 SPRST_NUM_STATES
249 } SPRECOSTATE;
251 typedef [hidden] enum SPWAVEFORMATTYPE
253 SPWF_INPUT,
254 SPWF_SRENGINE
255 } SPSTREAMFORMATTYPE;
257 typedef [restricted, hidden] struct SPRECOCONTEXTSTATUS
259 SPINTERFERENCE eInterference;
260 WCHAR szRequestTypeOfUI[255];
261 DWORD dwReserved1;
262 DWORD dwReserved2;
263 } SPRECOCONTEXTSTATUS;
265 typedef [hidden] enum SPAUDIOOPTIONS
267 SPAO_NONE,
268 SPAO_RETAIN_AUDIO
269 } SPAUDIOOPTIONS;
271 typedef [hidden] struct SPSERIALIZEDRESULT
273 ULONG ulSerializedSize;
274 } SPSERIALIZEDRESULT;
276 typedef [hidden] enum SPDISPLYATTRIBUTES
278 SPAF_ONE_TRAILING_SPACE = 0x02,
279 SPAF_TWO_TRAILING_SPACES = 0x04,
280 SPAF_CONSUME_LEADING_SPACES = 0x08,
281 SPAF_ALL = 0x0f
282 } SPDISPLAYATTRIBUTES;
284 typedef [hidden] enum SPBOOKMARKOPTIONS
286 SPBO_NONE,
287 SPBO_PAUSE
288 } SPBOOKMARKOPTIONS;
290 typedef [hidden] enum _SPAUDIOSTATE
292 SPAS_CLOSED,
293 SPAS_STOP,
294 SPAS_PAUSE,
295 SPAS_RUN
296 } SPAUDIOSTATE;
298 typedef [hidden] enum SPRUNSTATE
300 SPRS_DONE = (1L << 0),
301 SPRS_IS_SPEAKING = (1L << 1)
302 } SPRUNSTATE;
304 typedef [hidden] enum SPEAKFLAGS
306 SPF_DEFAULT = 0,
307 SPF_ASYNC = (1L << 0),
308 SPF_PURGEBEFORESPEAK = (1L << 1),
309 SPF_IS_FILENAME = (1L << 2),
310 SPF_IS_XML = (1L << 3),
311 SPF_IS_NOT_XML = (1L << 4),
312 SPF_PERSIST_XML = (1L << 5),
313 SPF_NLP_SPEAK_PUNC = (1L << 6),
314 SPF_PARSE_SAPI = (1L << 7),
315 SPF_PARSE_SSML = (1L << 8),
316 SPF_PARSE_AUTODETECT = 0,
317 SPF_NLP_MASK = (SPF_NLP_SPEAK_PUNC),
318 SPF_PARSE_MASK = (SPF_PARSE_SAPI|SPF_PARSE_SSML),
319 SPF_VOICE_MASK = (SPF_ASYNC|SPF_PURGEBEFORESPEAK|SPF_IS_FILENAME|SPF_IS_XML|SPF_IS_NOT_XML|SPF_NLP_MASK|SPF_PERSIST_XML|SPF_PARSE_MASK),
320 SPF_UNUSED_FLAGS = ~(SPF_VOICE_MASK)
321 } SPEAKFLAGS;
323 typedef [hidden] enum SPCFGRULEATTRIBUTES
325 SPRAF_TopLevel = (1 << 0),
326 SPRAF_Active = (1 << 1),
327 SPRAF_Export = (1 << 2),
328 SPRAF_Import = (1 << 3),
329 SPRAF_Interpreter = (1 << 4),
330 SPRAF_Dynamic = (1 << 5),
331 SPRAF_Root = (1 << 6),
332 SPRAF_AutoPause = (1 << 16),
333 SPRAF_UserDelimited = (1 << 17)
334 } SPCFGRULEATTRIBUTES;
336 typedef [hidden] enum SPPHRASERNG
338 SPPR_ALL_ELEMENTS = -1
339 } SPPHRASERNG;
341 typedef [hidden] enum SPVALUETYPE
343 SPDF_PROPERTY = 0x00000001,
344 SPDF_REPLACEMENT = 0x00000002,
345 SPDF_RULE = 0x00000004,
346 SPDF_DISPLAYTEXT = 0x00000008,
347 SPDF_LEXICALFORM = 0x00000010,
348 SPDF_PRONUNCIATION = 0x00000020,
349 SPDF_AUDIO = 0x00000040,
350 SPDF_ALTERNATES = 0x00000080,
351 SPDF_ALL = 0x000000ff
352 } SPVALUETYPE;
354 typedef unsigned short SPPHONEID;
356 typedef [restricted, hidden] struct SPPHRASEELEMENT
358 ULONG ulAudioTimeOffset;
359 ULONG ulAudioSizeTime;
360 ULONG ulAudioStreamOffset;
361 ULONG ulAudioSizeBytes;
362 ULONG ulRetainedStreamOffset;
363 ULONG ulRetainedSizeBytes;
364 const WCHAR *pszDisplayText;
365 const WCHAR *pszLexicalForm;
366 const SPPHONEID *pszPronunciation;
367 BYTE bDisplayAttributes;
368 signed char RequiredConfidence;
369 signed char ActualConfidence;
370 BYTE Reserved;
371 float SREngineConfidence;
372 } SPPHRASEELEMENT;
374 typedef [restricted, hidden] struct SPVOICESTATUS
376 ULONG ulCurrentStream;
377 ULONG ulLastStreamQueued;
378 HRESULT hrLastResult;
379 DWORD dwRunningState;
380 ULONG ulInputWordPos;
381 ULONG ulInputWordLen;
382 ULONG ulInputSentPos;
383 ULONG ulInputSentLen;
384 LONG lBookmarkId;
385 SPPHONEID PhonemeId;
386 SPVISEMES VisemeId;
387 DWORD dwReserved1;
388 DWORD dwReserved2;
389 } SPVOICESTATUS;
391 typedef [restricted, hidden] struct SPAUDIOSTATUS
393 long cbFreeBuffSpace;
394 ULONG cbNonBlockingIO;
395 SPAUDIOSTATE State;
396 ULONGLONG CurSeekPos;
397 ULONGLONG CurDevicePos;
398 DWORD dwAudioLevel;
399 DWORD dwReserved2;
400 } SPAUDIOSTATUS;
402 typedef [restricted, hidden] struct SPRECOGNIZERSTATUS
404 SPAUDIOSTATUS AudioStatus;
405 ULONGLONG ullRecognitionStreamPos;
406 ULONG ulStreamNumber;
407 ULONG ulNumActive;
408 CLSID clsidEngine;
409 ULONG cLangIDs;
410 LANGID aLangID[SP_MAX_LANGIDS];
411 ULONGLONG ullRecognitionStreamTime;
412 } SPRECOGNIZERSTATUS;
414 typedef [restricted, hidden] struct SPPHRASERULE SPPHRASERULE;
416 struct SPPHRASERULE
418 LPCWSTR pszName;
419 ULONG ulId;
420 ULONG ulFirstElement;
421 ULONG ulCountOfElements;
422 const SPPHRASERULE* pNextSibling;
423 const SPPHRASERULE* pFirstChild;
424 float SREngineConfidence;
425 signed char Confidence;
428 typedef [restricted, hidden] struct SPPHRASEPROPERTY SPPHRASEPROPERTY;
430 struct SPPHRASEPROPERTY
432 const WCHAR *pszName;
433 ULONG ulId;
434 const WCHAR *pszValue;
435 VARIANT vValue;
436 ULONG ulFirstElement;
437 ULONG ulCountOfElements;
438 const SPPHRASEPROPERTY *pNextSibling;
439 const SPPHRASEPROPERTY *pFirstChild;
440 float SREngineConfidence;
441 signed char Confidence;
444 typedef [restricted, hidden] struct SPPHRASEREPLACEMENT
446 BYTE bDisplayAttributes;
447 const WCHAR *pszReplacementText;
448 ULONG ulFirstElement;
449 ULONG ulCountOfElements;
450 } SPPHRASEREPLACEMENT;
452 typedef [restricted, hidden] struct SPPHRASE
454 ULONG cbSize;
455 LANGID LangID;
456 WORD wReserved;
457 ULONGLONG ullGrammarID;
458 ULONGLONG ftStartTime;
459 ULONGLONG ullAudioStreamPosition;
460 ULONG ulAudioSizeBytes;
461 ULONG ulRetainedSizeBytes;
462 ULONG ulAudioSizeTime;
463 SPPHRASERULE Rule;
464 const SPPHRASEPROPERTY *pProperties;
465 const SPPHRASEELEMENT *pElements;
466 ULONG cReplacements;
467 const SPPHRASEREPLACEMENT *pReplacements;
468 GUID SREngineID;
469 ULONG ulSREnginePrivateDataSize;
470 const BYTE *pSREnginePrivateData;
471 } SPPHRASE;
473 typedef [restricted, hidden] struct SPSERIALIZEDPHRASE
475 ULONG ulSerializedSize;
476 } SPSERIALIZEDPHRASE;
478 typedef [restricted, hidden] struct SPRECORESULTTIMES
480 FILETIME ftStreamTime;
481 ULONGLONG ullLength;
482 DWORD dwTickCount;
483 ULONGLONG ullStart;
484 } SPRECORESULTTIMES;
486 typedef [hidden] enum SPFILEMODE
488 SPFM_OPEN_READONLY,
489 SPFM_OPEN_READWRITE,
490 SPFM_CREATE,
491 SPFM_CREATE_ALWAYS,
492 SPFM_NUM_MODES
493 } SPFILEMODE;
495 cpp_quote("#if defined(__GNUC__)")
497 cpp_quote("#define SPCAT_AUDIOOUT (const WCHAR []){ 'H','K','E','Y','_','L','O','C','A','L','_','M','A','C','H','I','N','E','\\\\','S','O','F','T','W','A','R','E','\\\\','M','i','c','r','o','s','o','f','t','\\\\','S','p','e','e','c','h','\\\\','A','u','d','i','o','O','u','t','p','u','t',0 }")
498 cpp_quote("#define SPCAT_AUDIOIN (const WCHAR []){ 'H','K','E','Y','_','L','O','C','A','L','_','M','A','C','H','I','N','E','\\\\','S','O','F','T','W','A','R','E','\\\\','M','i','c','r','o','s','o','f','t','\\\\','S','p','e','e','c','h','\\\\','A','u','d','i','o','I','n','p','u','t',0 }")
499 cpp_quote("#define SPCAT_VOICES (const WCHAR []){ 'H','K','E','Y','_','L','O','C','A','L','_','M','A','C','H','I','N','E','\\\\','S','O','F','T','W','A','R','E','\\\\','M','i','c','r','o','s','o','f','t','\\\\','S','p','e','e','c','h','\\\\','V','o','i','c','e','s',0 }")
501 cpp_quote("#elif defined(_MSC_VER)")
503 cpp_quote("#define SPCAT_AUDIOOUT L\"HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Speech\\\\AudioOutput\"")
504 cpp_quote("#define SPCAT_AUDIOIN L\"HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Speech\\\\AudioInput\"")
505 cpp_quote("#define SPCAT_VOICES L\"HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Speech\\\\Voices\"")
507 cpp_quote("#else")
509 cpp_quote("static const WCHAR SPCAT_AUDIOOUT[] = {'H','K','E','Y','_','L','O','C','A','L','_','M','A','C','H','I','N','E','\\\\','S','O','F','T','W','A','R','E','\\\\','M','i','c','r','o','s','o','f','t','\\\\','S','p','e','e','c','h','\\\\','A','u','d','i','o','O','u','t','p','u','t',0};")
510 cpp_quote("static const WCHAR SPCAT_AUDIOIN[] = {'H','K','E','Y','_','L','O','C','A','L','_','M','A','C','H','I','N','E','\\\\','S','O','F','T','W','A','R','E','\\\\','M','i','c','r','o','s','o','f','t','\\\\','S','p','e','e','c','h','\\\\','A','u','d','i','o','I','n','p','u','t',0};")
511 cpp_quote("static const WCHAR SPCAT_VOICES[] = {'H','K','E','Y','_','L','O','C','A','L','_','M','A','C','H','I','N','E','\\\\','S','O','F','T','W','A','R','E','\\\\','M','i','c','r','o','s','o','f','t','\\\\','S','p','e','e','c','h','\\\\','V','o','i','c','e','s',0};")
513 cpp_quote("#endif")
515 interface IEnumSpObjectTokens;
516 interface ISpEventSource;
517 interface ISpRecoContext;
518 interface ISpRecognizer;
519 interface ISpStreamFormat;
522 object,
523 uuid(14056581-e16c-11d2-bb90-00c04f8ee6c0),
524 helpstring("ISpDataKey"),
525 pointer_default(unique),
526 local,
527 restricted
529 interface ISpDataKey : IUnknown
531 HRESULT SetData([in] LPCWSTR pszValueName,
532 [in] ULONG cbData,
533 [in] const BYTE *pData);
534 HRESULT GetData([in] LPCWSTR pszValueName,
535 [in] ULONG *pcbData,
536 [out] BYTE *pData);
537 HRESULT SetStringValue([in] LPCWSTR pszValueName,
538 [in] LPCWSTR pszValue);
539 HRESULT GetStringValue([in] LPCWSTR pszValueName,
540 [out] LPWSTR *ppszValue);
541 HRESULT SetDWORD([in] LPCWSTR pszValueName,
542 [in] DWORD dwValue);
543 HRESULT GetDWORD([in] LPCWSTR pszValueName,
544 [out] DWORD *pdwValue);
545 HRESULT OpenKey([in] LPCWSTR pszSubKeyName,
546 [out] ISpDataKey **ppSubKey);
547 HRESULT CreateKey([in] LPCWSTR pszSubKey,
548 [out] ISpDataKey **ppSubKey);
549 HRESULT DeleteKey([in] LPCWSTR pszSubKey);
550 HRESULT DeleteValue([in] LPCWSTR pszValueName);
551 HRESULT EnumKeys([in] ULONG Index,
552 [out] LPWSTR *ppszSubKeyName);
553 HRESULT EnumValues([in] ULONG Index,
554 [out] LPWSTR *ppszValueName);
557 object,
558 uuid(92a66e2b-c830-4149-83df-6fc2ba1e7a5b),
559 helpstring("ISpRegDataKey"),
560 pointer_default(unique),
561 restricted
563 interface ISpRegDataKey : ISpDataKey
565 [local] HRESULT SetKey([in] HKEY hkey, [in] BOOL fReadOnly);
569 object,
570 uuid(2d3d3845-39af-4850-bbf9-40b49780011d),
571 helpstring("ISpObjectTokenCategory"),
572 pointer_default(unique),
573 local,
574 restricted
576 interface ISpObjectTokenCategory : ISpDataKey
578 HRESULT SetId([in] LPCWSTR pszCategoryId,
579 [in] BOOL fCreateIfNotExist);
580 HRESULT GetId([out] LPWSTR *ppszCoMemCategoryId);
581 HRESULT GetDataKey([in] SPDATAKEYLOCATION spdkl,
582 [out] ISpDataKey **ppDataKey);
583 HRESULT EnumTokens([in, string] LPCWSTR pszReqAttribs,
584 [in, string] LPCWSTR pszOptAttribs,
585 [out] IEnumSpObjectTokens **ppEnum);
586 HRESULT SetDefaultTokenId([in] LPCWSTR pszTokenId);
587 HRESULT GetDefaultTokenId([out] LPWSTR *ppszCoMemTokenId);
591 object,
592 uuid(14056589-e16c-11d2-bb90-00c04f8ee6c0),
593 helpstring("ISpObjectToken"),
594 pointer_default(unique),
595 local,
596 restricted
598 interface ISpObjectToken : ISpDataKey
600 HRESULT SetId(/*[in]*/ LPCWSTR pszCategoryId,
601 [in] LPCWSTR pszTokenId,
602 [in] BOOL fCreateIfNotExist);
603 HRESULT GetId([out] LPWSTR *ppszCoMemTokenId);
604 HRESULT GetCategory([out] ISpObjectTokenCategory **ppTokenCategory);
605 HRESULT CreateInstance([in] IUnknown *pUnkOuter,
606 [in] DWORD dwClsContext,
607 [in] REFIID riid,
608 [out, iid_is(riid)] void **ppvObject);
609 HRESULT GetStorageFileName([in] REFCLSID clsidCaller,
610 [in] LPCWSTR pszValueName,
611 [in, string] LPCWSTR pszFileNameSpecifier,
612 [in] ULONG nFolder,
613 [out] LPWSTR *ppszFilePath);
614 HRESULT RemoveStorageFileName([in] REFCLSID clsidCaller,
615 [in] LPCWSTR pszKeyName,
616 [in] BOOL fDeleteFile);
617 HRESULT Remove(/*[in]*/ const CLSID *pclsidCaller);
618 [local] HRESULT IsUISupported([in] LPCWSTR pszTypeOfUI,
619 [in] void *pvExtraData,
620 [in] ULONG cbExtraData,
621 [in] IUnknown *punkObject,
622 [out] BOOL *pfSupported);
623 [local] HRESULT DisplayUI([in] HWND hwndParent,
624 [in] LPCWSTR pszTitle,
625 [in] LPCWSTR pszTypeOfUI,
626 [in] void *pvExtraData,
627 [in] ULONG cbExtraData,
628 [in] IUnknown *punkObject);
629 HRESULT MatchesAttributes([in] LPCWSTR pszAttributes,
630 [out] BOOL *pfMatches);
634 object,
635 uuid(06b64f9e-7fda-11d2-b4f2-00c04f797396),
636 helpstring("IEnumSpObjectTokens"),
637 pointer_default(unique),
638 local,
639 restricted
641 interface IEnumSpObjectTokens : IUnknown
643 HRESULT Next([in] ULONG celt,
644 [out, size_is(celt), length_is(*pceltFetched)] ISpObjectToken **pelt,
645 [out] ULONG *pceltFetched);
646 HRESULT Skip([in] ULONG celt);
647 HRESULT Reset(void);
648 HRESULT Clone([out] IEnumSpObjectTokens **ppEnum);
649 HRESULT Item([in] ULONG Index,
650 [out] ISpObjectToken **ppToken);
651 HRESULT GetCount([out] ULONG *pCount);
655 object,
656 uuid(93384e18-5014-43d5-adbb-a78e055926bd),
657 helpstring("ISpResourceManager"),
658 pointer_default(unique),
659 restricted
661 interface ISpResourceManager : IServiceProvider
663 HRESULT SetObject([in] REFGUID guidServiceId,
664 [in] IUnknown *pUnkObject);
665 HRESULT GetObject([in] REFGUID guidServiceId,
666 [in] REFCLSID ObjectCLSID,
667 [in] REFIID ObjectIID,
668 [in] BOOL fReleaseWhenLastExternalRefReleased,
669 [out, iid_is(ObjectIID)] void** ppObject);
673 object,
674 uuid(1a5c0354-b621-4b5a-8791-d306ed379e53),
675 local,
676 pointer_default(unique),
677 restricted
679 interface ISpPhrase : IUnknown
681 HRESULT GetPhrase([out] SPPHRASE **phrase);
682 HRESULT GetSerializedPhrase([out] SPSERIALIZEDPHRASE **phrase);
683 HRESULT GetText([in] ULONG start, [in] ULONG count, [in] BOOL replacements,
684 [out] WCHAR **text, [out] BYTE *attributes);
685 HRESULT Discard([in] DWORD types);
689 object,
690 uuid(8fcebc98-4e49-4067-9c6c-d86a0e092e3d),
691 local,
692 pointer_default(unique),
693 restricted
695 interface ISpPhraseAlt : ISpPhrase
697 HRESULT GetAltInfo(ISpPhrase **parent, ULONG *start, ULONG *count,
698 ULONG *elements);
699 HRESULT Commit();
703 object,
704 uuid(20b053be-e235-43cd-9a2a-8d17a48b7842),
705 pointer_default(unique),
706 local,
707 restricted
709 interface ISpRecoResult : ISpPhrase
711 HRESULT GetResultTimes([out] SPRECORESULTTIMES *times);
713 HRESULT GetAlternates(
714 [in] ULONG start,
715 [in] ULONG elements,
716 [in] ULONG count,
717 [out] ISpPhraseAlt **phrases,
718 [out] ULONG *returned);
720 HRESULT GetAudio(
721 [in] ULONG start,
722 [in] ULONG elements,
723 [out] ISpStreamFormat **stream);
724 HRESULT SpeakAudio(
725 [in] ULONG start,
726 [in] ULONG elements,
727 [in] DWORD flags,
728 [out] ULONG *number);
730 HRESULT Serialize([out] SPSERIALIZEDRESULT **result);
732 HRESULT ScaleAudio([in] const GUID *format, [in] const WAVEFORMATEX *wave);
734 HRESULT GetRecoContext([out] ISpRecoContext *context);
738 object,
739 uuid(8137828f-591a-4a42-be58-49ea7ebaac68),
740 helpstring("ISpGrammarBuilder Interface"),
741 pointer_default(unique),
742 restricted,
743 local
745 interface ISpGrammarBuilder : IUnknown
747 HRESULT ResetGrammar([in] LANGID language);
749 HRESULT GetRule([in] const WCHAR *rule,
750 [in] DWORD id,
751 [in] DWORD attributes,
752 [in] BOOL should_create,
753 [out] SPSTATEHANDLE *state);
754 HRESULT ClearRule(SPSTATEHANDLE state);
756 HRESULT CreateNewState(
757 [in] SPSTATEHANDLE instate,
758 [out] SPSTATEHANDLE *outstate);
760 HRESULT AddWordTransition(
761 [in] SPSTATEHANDLE from_state,
762 [in] SPSTATEHANDLE to_state,
763 [in] const WCHAR *value,
764 [in] const WCHAR *separators,
765 [in] SPGRAMMARWORDTYPE type,
766 [in] float weight,
767 [in] const SPPROPERTYINFO *info);
769 HRESULT AddRuleTransition(
770 [in] SPSTATEHANDLE from_state,
771 [in] SPSTATEHANDLE to_state,
772 [in] SPSTATEHANDLE rule,
773 [in] float weight,
774 [in] const SPPROPERTYINFO *info);
776 HRESULT AddResource([in] SPSTATEHANDLE state,
777 [in] const WCHAR *name,
778 [in] const WCHAR *value);
780 HRESULT Commit([in] DWORD reserved);
784 object,
785 uuid(2177db29-7f45-47d0-8554-067e91c80502),
786 pointer_default(unique),
787 restricted,
788 local
790 interface ISpRecoGrammar : ISpGrammarBuilder
792 HRESULT GetGrammarId([out] ULONGLONG *grammar);
793 HRESULT GetRecoContext([out] ISpRecoContext **context);
795 HRESULT LoadCmdFromFile([in, string] const WCHAR * pszFileName, [in] SPLOADOPTIONS options);
796 HRESULT LoadCmdFromObject([in] REFCLSID rcid, [in, string] const WCHAR * pszGrammarName, [in] SPLOADOPTIONS options);
797 HRESULT LoadCmdFromResource([in] HMODULE hmod,
798 [in, string] const WCHAR *name,
799 [in, string] const WCHAR *type,
800 [in] WORD language,
801 [in] SPLOADOPTIONS options);
802 HRESULT LoadCmdFromMemory([in] const SPBINARYGRAMMAR *grammar, [in] SPLOADOPTIONS options);
803 HRESULT LoadCmdFromProprietaryGrammar(
804 [in] REFGUID guid,
805 [in, string] const WCHAR *param,
806 [in] const void *data,
807 [in] ULONG size,
808 [in] SPLOADOPTIONS options);
809 HRESULT SetRuleState([in, string] const WCHAR *name, [in] void *reserved,
810 [in] SPRULESTATE state);
811 HRESULT SetRuleIdState([in] ULONG rule, [in] SPRULESTATE state);
813 HRESULT LoadDictation([in, string] const WCHAR *name, [in] SPLOADOPTIONS options);
814 HRESULT UnloadDictation();
815 HRESULT SetDictationState([in] SPRULESTATE state);
817 HRESULT SetWordSequenceData([in] const WCHAR *text, [in] ULONG count, [in] const SPTEXTSELECTIONINFO *info);
818 HRESULT SetTextSelection([in] const SPTEXTSELECTIONINFO *info);
820 HRESULT IsPronounceable([in, string] const WCHAR *word, [out] SPWORDPRONOUNCEABLE *pronounceable);
822 HRESULT SetGrammarState([in] SPGRAMMARSTATE state);
824 HRESULT SaveCmd([in] IStream *stream, [out, optional] WCHAR **error);
826 HRESULT GetGrammarState([out] SPGRAMMARSTATE *state);
830 object,
831 uuid(259684dc-37c3-11d2-9603-00c04f8ee628),
832 pointer_default(unique),
833 restricted
835 interface ISpNotifySink : IUnknown
837 HRESULT Notify(void);
841 object,
842 uuid(6c44df74-72b9-4992-a1ec-ef996e0422d4),
843 pointer_default(unique),
844 restricted
846 interface ISpVoice : ISpEventSource
848 HRESULT SetOutput([in] IUnknown *unk, [in] BOOL changes);
849 HRESULT GetOutputObjectToken([out] ISpObjectToken **token);
850 HRESULT GetOutputStream([out] ISpStreamFormat **stream);
852 HRESULT Pause(void);
853 HRESULT Resume(void);
855 HRESULT SetVoice([in] ISpObjectToken *token);
856 HRESULT GetVoice([out] ISpObjectToken **token);
858 HRESULT Speak([in, string] const WCHAR *pwcs,
859 [in] DWORD flags,
860 [out] ULONG *number);
861 HRESULT SpeakStream([in] IStream *stream,
862 [in] DWORD flags,
863 [out] ULONG *number);
865 HRESULT GetStatus(
866 [out] SPVOICESTATUS *status,
867 [out, string] WCHAR **bookmark);
869 HRESULT Skip([in,string] const WCHAR *type, [in] long items, [out] ULONG *skipped);
871 HRESULT SetPriority([in] SPVPRIORITY priority);
872 HRESULT GetPriority([out] SPVPRIORITY* priority);
874 HRESULT SetAlertBoundary([in] SPEVENTENUM boundary);
875 HRESULT GetAlertBoundary([out] SPEVENTENUM* boundary);
877 HRESULT SetRate([in] long adjust);
878 HRESULT GetRate([out] long *adjust);
880 HRESULT SetVolume([in] USHORT volume);
881 HRESULT GetVolume([out] USHORT *volume);
883 HRESULT WaitUntilDone([in] ULONG timeout);
885 HRESULT SetSyncSpeakTimeout([in] ULONG timeout);
886 HRESULT GetSyncSpeakTimeout([out] ULONG *timeout);
888 [local] HANDLE SpeakCompleteEvent();
890 [local] HRESULT IsUISupported(
891 [in] const WCHAR *type,
892 [in] void * extra,
893 [in] ULONG count,
894 [out] BOOL *supported);
895 [local] HRESULT DisplayUI(
896 [in] HWND parent,
897 [in] const WCHAR *title,
898 [in] const WCHAR *type,
899 [in] void *extra,
900 [in] ULONG count);
904 object,
905 uuid(5eff4aef-8487-11d2-961c-00c04f8ee628),
906 pointer_default(unique),
907 restricted
909 interface ISpNotifySource : IUnknown
911 HRESULT SetNotifySink([in] ISpNotifySink *sink);
912 [local] HRESULT SetNotifyWindowMessage(
913 [in] HWND hwnd,
914 [in] UINT msg,
915 [in] WPARAM wparam,
916 [in] LPARAM lparam);
917 [local] HRESULT SetNotifyCallbackFunction(
918 [in] SPNOTIFYCALLBACK *callback,
919 [in] WPARAM wparam,
920 [in] LPARAM lparam);
921 [local] HRESULT SetNotifyCallbackInterface(
922 [in] ISpNotifyCallback *callback,
923 [in] WPARAM wparam,
924 [in] LPARAM lparam);
925 [local] HRESULT SetNotifyWin32Event(void);
926 [local] HRESULT WaitForNotifyEvent([in] DWORD milliseconds);
927 [local] HANDLE GetNotifyEventHandle();
931 object,
932 uuid(be7a9cce-5f9e-11d2-960f-00c04f8ee628),
933 pointer_default(unique),
934 local,
935 restricted
937 interface ISpEventSource : ISpNotifySource
939 HRESULT SetInterest([in] ULONGLONG event, [in] ULONGLONG queued);
940 HRESULT GetEvents([in] ULONG count,
941 [out, size_is(count)] SPEVENT *array,
942 [out] ULONG *fetched);
943 HRESULT GetInfo([out] SPEVENTSOURCEINFO *info);
947 object,
948 uuid(f740a62f-7c15-489e-8234-940a33d9272d),
949 pointer_default(unique),
950 local,
951 restricted
953 interface ISpRecoContext : ISpEventSource
955 HRESULT GetRecognizer([out] ISpRecognizer **recognizer);
957 HRESULT CreateGrammar([in] ULONGLONG grammar, [out] ISpRecoGrammar **spgrammar);
959 HRESULT GetStatus([out] SPRECOCONTEXTSTATUS *status);
961 HRESULT GetMaxAlternates([in] ULONG *alternates);
962 HRESULT SetMaxAlternates([in] ULONG alternates);
964 HRESULT SetAudioOptions([in] SPAUDIOOPTIONS options, [in] const GUID *format, [in] const WAVEFORMATEX *wave);
965 HRESULT GetAudioOptions([in] SPAUDIOOPTIONS *options, [out] GUID *format, [out] WAVEFORMATEX **wave);
967 HRESULT DeserializeResult([in] const SPSERIALIZEDRESULT *serialized, [out] ISpRecoResult **result);
969 HRESULT Bookmark([in] SPBOOKMARKOPTIONS options, [in] ULONGLONG position, [in] LPARAM event);
971 HRESULT SetAdaptationData([in, string] const WCHAR *data, [in] const ULONG count);
973 HRESULT Pause(DWORD reserved);
974 HRESULT Resume(DWORD reserved);
976 HRESULT SetVoice([in] ISpVoice *voice, [in] BOOL changes);
977 HRESULT GetVoice([out] ISpVoice **voice);
978 HRESULT SetVoicePurgeEvent([in] ULONGLONG interest);
979 HRESULT GetVoicePurgeEvent([out] ULONGLONG *interest);
981 HRESULT SetContextState([in] SPCONTEXTSTATE state);
982 HRESULT GetContextState([in] SPCONTEXTSTATE *state);
986 object,
987 uuid(bed530be-2606-4f4d-a1c0-54c5cda5566f),
988 pointer_default(unique),
989 restricted
991 interface ISpStreamFormat : IStream
993 HRESULT GetFormat(GUID *format, WAVEFORMATEX **wave);
997 object,
998 uuid(5b4fb971-b115-4de1-ad97-e482e3bf6ee4),
999 pointer_default(unique),
1000 local,
1001 restricted
1003 interface ISpProperties : IUnknown
1005 HRESULT SetPropertyNum([in] const WCHAR *name, [in] long value);
1006 HRESULT GetPropertyNum([in] const WCHAR *name, [out] long *value);
1007 HRESULT SetPropertyString([in] const WCHAR *name, [in] const WCHAR *value);
1008 HRESULT GetPropertyString([in] const WCHAR *name, [out] WCHAR **value);
1012 object,
1013 uuid(c2b5f241-daa0-4507-9e16-5a1eaa2b7a5c),
1014 pointer_default(unique),
1015 restricted
1017 interface ISpRecognizer : ISpProperties
1019 HRESULT SetRecognizer([in] ISpObjectToken *recognizer);
1020 HRESULT GetRecognizer([out] ISpObjectToken **recognizer);
1022 HRESULT SetInput([in] IUnknown *input, [in] BOOL changes);
1023 HRESULT GetInputObjectToken([out] ISpObjectToken **token);
1025 HRESULT GetInputStream( [out] ISpStreamFormat **stream);
1026 HRESULT CreateRecoContext([out] ISpRecoContext **cxt);
1028 HRESULT GetRecoProfile([out] ISpObjectToken **token);
1029 HRESULT SetRecoProfile([in] ISpObjectToken *token);
1031 HRESULT IsSharedInstance(void);
1033 HRESULT GetRecoState([out] SPRECOSTATE *state);
1034 HRESULT SetRecoState([in] SPRECOSTATE state);
1036 HRESULT GetStatus([out] SPRECOGNIZERSTATUS *status);
1037 HRESULT GetFormat([in] SPSTREAMFORMATTYPE type, [out] GUID *format, [out] WAVEFORMATEX **wave);
1039 [local] HRESULT IsUISupported([in] const WCHAR *type, [in] void *extra, [in] ULONG count,
1040 [out] BOOL *supported);
1041 [local] HRESULT DisplayUI([in] HWND hwnd,[in] const WCHAR *title, [in] const WCHAR *type,
1042 [in] void *extra, [in] ULONG cnt);
1043 HRESULT EmulateRecognition([in] ISpPhrase *phrase);
1047 object,
1048 uuid(12e3cca9-7518-44c5-a5e7-ba5a79cb929e),
1049 pointer_default(unique),
1050 local,
1051 restricted
1053 interface ISpStream : ISpStreamFormat
1055 HRESULT SetBaseStream([in] IStream *stream, [in] REFGUID format, [in] const WAVEFORMATEX *wave);
1056 HRESULT GetBaseStream([out] IStream **stream);
1057 HRESULT BindToFile([in] LPCWSTR filename, [in] SPFILEMODE mode, [in] const GUID *format,
1058 const WAVEFORMATEX *wave, [in] ULONGLONG interest);
1059 HRESULT Close();
1063 helpstring("Speech Object Library"),
1064 uuid(c866ca3a-32f7-11d2-9602-00c04f8ee628),
1065 version(5.4)
1067 library SpeechLib
1069 importlib("stdole2.tlb");
1071 #include "sapiaut.idl"
1074 uuid(a910187f-0c7a-45ac-92cc-59edafb77b53),
1075 helpstring("SpObjectTokenCategory Class"),
1076 progid("SAPI.SpObjectTokenCategory.1"),
1077 vi_progid("SAPI.SpObjectTokenCategory"),
1078 threading(both)
1080 coclass SpObjectTokenCategory
1082 interface ISpObjectTokenCategory;
1086 uuid(ef411752-3736-4cb4-9c8c-8ef4ccb58efe),
1087 helpstring("Object Token"),
1088 progid("SAPI.SpObjectToken.1"),
1089 vi_progid("SAPI.SpObjectToken"),
1090 threading(both)
1092 coclass SpObjectToken
1094 interface ISpObjectToken;
1095 [default] interface ISpDataKey;
1099 uuid(96749373-3391-11d2-9ee3-00c04f797396),
1100 helpstring("Resource Manager"),
1101 progid("SAPI.SpResourceManager.1"),
1102 vi_progid("SAPI.SpResourceManager"),
1103 threading(both),
1104 restricted,
1105 hidden
1107 coclass SpResourceManager
1109 [default] interface ISpResourceManager;
1113 uuid(3bee4890-4fe9-4a37-8c1e-5e7e12791c1f)
1115 coclass SpSharedRecognizer
1117 /*[default] interface ISpeechRecognizer;*/
1118 interface ISpRecognizer;
1122 uuid(715d9c59-4442-11d2-9605-00c04f8ee628),
1123 helpstring("Speech Stream"),
1124 progid("SAPI.SpStream.1"),
1125 vi_progid("SAPI.SpStream"),
1126 threading(both),
1127 restricted,
1128 hidden
1130 coclass SpStream
1132 interface ISpStream;
1136 uuid(96749377-3391-11d2-9ee3-00c04f797396)
1138 coclass SpVoice
1140 interface ISpVoice;
1141 [default] interface ISpeechVoice;
1145 uuid(947812b3-2ae1-4644-ba86-9e90ded7ec91),
1147 coclass SpFileStream
1149 interface ISpStream;
1150 [default] interface ISpeechFileStream;