comctl32: Fix Str_SetPtr[AW] spec file entries.
[wine.git] / include / sapi.idl
blob9e6ba5be5eac9b5a94332fe0aa540810b96c4262
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(1a5c0354-b621-4b5a-8791-d306ed379e53),
657 local,
658 pointer_default(unique),
659 restricted
661 interface ISpPhrase : IUnknown
663 HRESULT GetPhrase([out] SPPHRASE **phrase);
664 HRESULT GetSerializedPhrase([out] SPSERIALIZEDPHRASE **phrase);
665 HRESULT GetText([in] ULONG start, [in] ULONG count, [in] BOOL replacements,
666 [out] WCHAR **text, [out] BYTE *attributes);
667 HRESULT Discard([in] DWORD types);
671 object,
672 uuid(8fcebc98-4e49-4067-9c6c-d86a0e092e3d),
673 local,
674 pointer_default(unique),
675 restricted
677 interface ISpPhraseAlt : ISpPhrase
679 HRESULT GetAltInfo(ISpPhrase **parent, ULONG *start, ULONG *count,
680 ULONG *elements);
681 HRESULT Commit();
685 object,
686 uuid(20b053be-e235-43cd-9a2a-8d17a48b7842),
687 pointer_default(unique),
688 local,
689 restricted
691 interface ISpRecoResult : ISpPhrase
693 HRESULT GetResultTimes([out] SPRECORESULTTIMES *times);
695 HRESULT GetAlternates(
696 [in] ULONG start,
697 [in] ULONG elements,
698 [in] ULONG count,
699 [out] ISpPhraseAlt **phrases,
700 [out] ULONG *returned);
702 HRESULT GetAudio(
703 [in] ULONG start,
704 [in] ULONG elements,
705 [out] ISpStreamFormat **stream);
706 HRESULT SpeakAudio(
707 [in] ULONG start,
708 [in] ULONG elements,
709 [in] DWORD flags,
710 [out] ULONG *number);
712 HRESULT Serialize([out] SPSERIALIZEDRESULT **result);
714 HRESULT ScaleAudio([in] const GUID *format, [in] const WAVEFORMATEX *wave);
716 HRESULT GetRecoContext([out] ISpRecoContext *context);
720 object,
721 uuid(8137828f-591a-4a42-be58-49ea7ebaac68),
722 helpstring("ISpGrammarBuilder Interface"),
723 pointer_default(unique),
724 restricted,
725 local
727 interface ISpGrammarBuilder : IUnknown
729 HRESULT ResetGrammar([in] LANGID language);
731 HRESULT GetRule([in] const WCHAR *rule,
732 [in] DWORD id,
733 [in] DWORD attributes,
734 [in] BOOL should_create,
735 [out] SPSTATEHANDLE *state);
736 HRESULT ClearRule(SPSTATEHANDLE state);
738 HRESULT CreateNewState(
739 [in] SPSTATEHANDLE instate,
740 [out] SPSTATEHANDLE *outstate);
742 HRESULT AddWordTransition(
743 [in] SPSTATEHANDLE from_state,
744 [in] SPSTATEHANDLE to_state,
745 [in] const WCHAR *value,
746 [in] const WCHAR *separators,
747 [in] SPGRAMMARWORDTYPE type,
748 [in] float weight,
749 [in] const SPPROPERTYINFO *info);
751 HRESULT AddRuleTransition(
752 [in] SPSTATEHANDLE from_state,
753 [in] SPSTATEHANDLE to_state,
754 [in] SPSTATEHANDLE rule,
755 [in] float weight,
756 [in] const SPPROPERTYINFO *info);
758 HRESULT AddResource([in] SPSTATEHANDLE state,
759 [in] const WCHAR *name,
760 [in] const WCHAR *value);
762 HRESULT Commit([in] DWORD reserved);
766 object,
767 uuid(2177db29-7f45-47d0-8554-067e91c80502),
768 pointer_default(unique),
769 restricted,
770 local
772 interface ISpRecoGrammar : ISpGrammarBuilder
774 HRESULT GetGrammarId([out] ULONGLONG *grammar);
775 HRESULT GetRecoContext([out] ISpRecoContext **context);
777 HRESULT LoadCmdFromFile([in, string] const WCHAR * pszFileName, [in] SPLOADOPTIONS options);
778 HRESULT LoadCmdFromObject([in] REFCLSID rcid, [in, string] const WCHAR * pszGrammarName, [in] SPLOADOPTIONS options);
779 HRESULT LoadCmdFromResource([in] HMODULE hmod,
780 [in, string] const WCHAR *name,
781 [in, string] const WCHAR *type,
782 [in] WORD language,
783 [in] SPLOADOPTIONS options);
784 HRESULT LoadCmdFromMemory([in] const SPBINARYGRAMMAR *grammar, [in] SPLOADOPTIONS options);
785 HRESULT LoadCmdFromProprietaryGrammar(
786 [in] REFGUID guid,
787 [in, string] const WCHAR *param,
788 [in] const void *data,
789 [in] ULONG size,
790 [in] SPLOADOPTIONS options);
791 HRESULT SetRuleState([in, string] const WCHAR *name, [in] void *reserved,
792 [in] SPRULESTATE state);
793 HRESULT SetRuleIdState([in] ULONG rule, [in] SPRULESTATE state);
795 HRESULT LoadDictation([in, string] const WCHAR *name, [in] SPLOADOPTIONS options);
796 HRESULT UnloadDictation();
797 HRESULT SetDictationState([in] SPRULESTATE state);
799 HRESULT SetWordSequenceData([in] const WCHAR *text, [in] ULONG count, [in] const SPTEXTSELECTIONINFO *info);
800 HRESULT SetTextSelection([in] const SPTEXTSELECTIONINFO *info);
802 HRESULT IsPronounceable([in, string] const WCHAR *word, [out] SPWORDPRONOUNCEABLE *pronounceable);
804 HRESULT SetGrammarState([in] SPGRAMMARSTATE state);
806 HRESULT SaveCmd([in] IStream *stream, [out, optional] WCHAR **error);
808 HRESULT GetGrammarState([out] SPGRAMMARSTATE *state);
812 object,
813 uuid(259684dc-37c3-11d2-9603-00c04f8ee628),
814 pointer_default(unique),
815 restricted
817 interface ISpNotifySink : IUnknown
819 HRESULT Notify(void);
823 object,
824 uuid(6c44df74-72b9-4992-a1ec-ef996e0422d4),
825 pointer_default(unique),
826 restricted
828 interface ISpVoice : ISpEventSource
830 HRESULT SetOutput([in] IUnknown *unk, [in] BOOL changes);
831 HRESULT GetOutputObjectToken([out] ISpObjectToken **token);
832 HRESULT GetOutputStream([out] ISpStreamFormat **stream);
834 HRESULT Pause(void);
835 HRESULT Resume(void);
837 HRESULT SetVoice([in] ISpObjectToken *token);
838 HRESULT GetVoice([out] ISpObjectToken **token);
840 HRESULT Speak([in, string] const WCHAR *pwcs,
841 [in] DWORD flags,
842 [out] ULONG *number);
843 HRESULT SpeakStream([in] IStream *stream,
844 [in] DWORD flags,
845 [out] ULONG *number);
847 HRESULT GetStatus(
848 [out] SPVOICESTATUS *status,
849 [out, string] WCHAR **bookmark);
851 HRESULT Skip([in,string] const WCHAR *type, [in] long items, [out] ULONG *skipped);
853 HRESULT SetPriority([in] SPVPRIORITY priority);
854 HRESULT GetPriority([out] SPVPRIORITY* priority);
856 HRESULT SetAlertBoundary([in] SPEVENTENUM boundary);
857 HRESULT GetAlertBoundary([out] SPEVENTENUM* boundary);
859 HRESULT SetRate([in] long adjust);
860 HRESULT GetRate([out] long *adjust);
862 HRESULT SetVolume([in] USHORT volume);
863 HRESULT GetVolume([out] USHORT *volume);
865 HRESULT WaitUntilDone([in] ULONG timeout);
867 HRESULT SetSyncSpeakTimeout([in] ULONG timeout);
868 HRESULT GetSyncSpeakTimeout([out] ULONG *timeout);
870 [local] HANDLE SpeakCompleteEvent();
872 [local] HRESULT IsUISupported(
873 [in] const WCHAR *type,
874 [in] void * extra,
875 [in] ULONG count,
876 [out] BOOL *supported);
877 [local] HRESULT DisplayUI(
878 [in] HWND parent,
879 [in] const WCHAR *title,
880 [in] const WCHAR *type,
881 [in] void *extra,
882 [in] ULONG count);
886 object,
887 uuid(5eff4aef-8487-11d2-961c-00c04f8ee628),
888 pointer_default(unique),
889 restricted
891 interface ISpNotifySource : IUnknown
893 HRESULT SetNotifySink([in] ISpNotifySink *sink);
894 [local] HRESULT SetNotifyWindowMessage(
895 [in] HWND hwnd,
896 [in] UINT msg,
897 [in] WPARAM wparam,
898 [in] LPARAM lparam);
899 [local] HRESULT SetNotifyCallbackFunction(
900 [in] SPNOTIFYCALLBACK *callback,
901 [in] WPARAM wparam,
902 [in] LPARAM lparam);
903 [local] HRESULT SetNotifyCallbackInterface(
904 [in] ISpNotifyCallback *callback,
905 [in] WPARAM wparam,
906 [in] LPARAM lparam);
907 [local] HRESULT SetNotifyWin32Event(void);
908 [local] HRESULT WaitForNotifyEvent([in] DWORD milliseconds);
909 [local] HANDLE GetNotifyEventHandle();
913 object,
914 uuid(be7a9cce-5f9e-11d2-960f-00c04f8ee628),
915 pointer_default(unique),
916 local,
917 restricted
919 interface ISpEventSource : ISpNotifySource
921 HRESULT SetInterest([in] ULONGLONG event, [in] ULONGLONG queued);
922 HRESULT GetEvents([in] ULONG count,
923 [out, size_is(count)] SPEVENT *array,
924 [out] ULONG *fetched);
925 HRESULT GetInfo([out] SPEVENTSOURCEINFO *info);
929 object,
930 uuid(f740a62f-7c15-489e-8234-940a33d9272d),
931 pointer_default(unique),
932 local,
933 restricted
935 interface ISpRecoContext : ISpEventSource
937 HRESULT GetRecognizer([out] ISpRecognizer **recognizer);
939 HRESULT CreateGrammar([in] ULONGLONG grammar, [out] ISpRecoGrammar **spgrammar);
941 HRESULT GetStatus([out] SPRECOCONTEXTSTATUS *status);
943 HRESULT GetMaxAlternates([in] ULONG *alternates);
944 HRESULT SetMaxAlternates([in] ULONG alternates);
946 HRESULT SetAudioOptions([in] SPAUDIOOPTIONS options, [in] const GUID *format, [in] const WAVEFORMATEX *wave);
947 HRESULT GetAudioOptions([in] SPAUDIOOPTIONS *options, [out] GUID *format, [out] WAVEFORMATEX **wave);
949 HRESULT DeserializeResult([in] const SPSERIALIZEDRESULT *serialized, [out] ISpRecoResult **result);
951 HRESULT Bookmark([in] SPBOOKMARKOPTIONS options, [in] ULONGLONG position, [in] LPARAM event);
953 HRESULT SetAdaptationData([in, string] const WCHAR *data, [in] const ULONG count);
955 HRESULT Pause(DWORD reserved);
956 HRESULT Resume(DWORD reserved);
958 HRESULT SetVoice([in] ISpVoice *voice, [in] BOOL changes);
959 HRESULT GetVoice([out] ISpVoice **voice);
960 HRESULT SetVoicePurgeEvent([in] ULONGLONG interest);
961 HRESULT GetVoicePurgeEvent([out] ULONGLONG *interest);
963 HRESULT SetContextState([in] SPCONTEXTSTATE state);
964 HRESULT GetContextState([in] SPCONTEXTSTATE *state);
968 object,
969 uuid(bed530be-2606-4f4d-a1c0-54c5cda5566f),
970 pointer_default(unique),
971 restricted
973 interface ISpStreamFormat : IStream
975 HRESULT GetFormat(GUID *format, WAVEFORMATEX **wave);
979 object,
980 uuid(5b4fb971-b115-4de1-ad97-e482e3bf6ee4),
981 pointer_default(unique),
982 local,
983 restricted
985 interface ISpProperties : IUnknown
987 HRESULT SetPropertyNum([in] const WCHAR *name, [in] long value);
988 HRESULT GetPropertyNum([in] const WCHAR *name, [out] long *value);
989 HRESULT SetPropertyString([in] const WCHAR *name, [in] const WCHAR *value);
990 HRESULT GetPropertyString([in] const WCHAR *name, [out] WCHAR **value);
994 object,
995 uuid(c2b5f241-daa0-4507-9e16-5a1eaa2b7a5c),
996 pointer_default(unique),
997 restricted
999 interface ISpRecognizer : ISpProperties
1001 HRESULT SetRecognizer([in] ISpObjectToken *recognizer);
1002 HRESULT GetRecognizer([out] ISpObjectToken **recognizer);
1004 HRESULT SetInput([in] IUnknown *input, [in] BOOL changes);
1005 HRESULT GetInputObjectToken([out] ISpObjectToken **token);
1007 HRESULT GetInputStream( [out] ISpStreamFormat **stream);
1008 HRESULT CreateRecoContext([out] ISpRecoContext **cxt);
1010 HRESULT GetRecoProfile([out] ISpObjectToken **token);
1011 HRESULT SetRecoProfile([in] ISpObjectToken *token);
1013 HRESULT IsSharedInstance(void);
1015 HRESULT GetRecoState([out] SPRECOSTATE *state);
1016 HRESULT SetRecoState([in] SPRECOSTATE state);
1018 HRESULT GetStatus([out] SPRECOGNIZERSTATUS *status);
1019 HRESULT GetFormat([in] SPSTREAMFORMATTYPE type, [out] GUID *format, [out] WAVEFORMATEX **wave);
1021 [local] HRESULT IsUISupported([in] const WCHAR *type, [in] void *extra, [in] ULONG count,
1022 [out] BOOL *supported);
1023 [local] HRESULT DisplayUI([in] HWND hwnd,[in] const WCHAR *title, [in] const WCHAR *type,
1024 [in] void *extra, [in] ULONG cnt);
1025 HRESULT EmulateRecognition([in] ISpPhrase *phrase);
1029 object,
1030 uuid(12e3cca9-7518-44c5-a5e7-ba5a79cb929e),
1031 pointer_default(unique),
1032 local,
1033 restricted
1035 interface ISpStream : ISpStreamFormat
1037 HRESULT SetBaseStream([in] IStream *stream, [in] REFGUID format, [in] const WAVEFORMATEX *wave);
1038 HRESULT GetBaseStream([out] IStream **stream);
1039 HRESULT BindToFile([in] LPCWSTR filename, [in] SPFILEMODE mode, [in] const GUID *format,
1040 const WAVEFORMATEX *wave, [in] ULONGLONG interest);
1041 HRESULT Close();
1045 helpstring("Speech Object Library"),
1046 uuid(c866ca3a-32f7-11d2-9602-00c04f8ee628),
1047 version(5.4)
1049 library SpeechLib
1051 importlib("stdole2.tlb");
1053 #include "sapiaut.idl"
1056 uuid(a910187f-0c7a-45ac-92cc-59edafb77b53),
1057 helpstring("SpObjectTokenCategory Class"),
1058 progid("SAPI.SpObjectTokenCategory.1"),
1059 vi_progid("SAPI.SpObjectTokenCategory"),
1060 threading(both)
1062 coclass SpObjectTokenCategory
1064 interface ISpObjectTokenCategory;
1068 uuid(3bee4890-4fe9-4a37-8c1e-5e7e12791c1f)
1070 coclass SpSharedRecognizer
1072 /*[default] interface ISpeechRecognizer;*/
1073 interface ISpRecognizer;
1077 uuid(96749377-3391-11d2-9ee3-00c04f797396)
1079 coclass SpVoice
1081 interface ISpVoice;
1082 [default] interface ISpeechVoice;
1086 uuid(947812b3-2ae1-4644-ba86-9e90ded7ec91),
1088 coclass SpFileStream
1090 interface ISpStream;
1091 [default] interface ISpeechFileStream;