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
25 #define threading
(model
)
27 #define vi_progid
(str
)
31 typedef [restricted, hidden] struct WAVEFORMATEX
36 DWORD nAvgBytesPerSec
;
42 cpp_quote
("#include <mmsystem.h>")
45 cpp_quote
("#if defined(__cplusplus)")
46 cpp_quote
("interface ISpNotifyCallback")
48 cpp_quote
("virtual HRESULT STDMETHODCALLTYPE NotifyCallback(WPARAM wParam, LPARAM lParam) = 0;")
51 typedef void * ISpNotifyCallback
;
55 typedef void * SPNOTIFYCALLBACK
;
56 typedef void * SPSTATEHANDLE
;
59 typedef [restricted, hidden] struct SPEVENT
64 ULONGLONG ullAudioStreamOffset
;
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
;
81 typedef [hidden] enum SPGRAMMARWORDTYPE
86 SPWT_LEXICAL_NO_SPECIAL_CHARS
89 typedef [hidden] struct tagSPPROPERTYINFO
93 const WCHAR
*pszValue
;
97 typedef [hidden] enum SPDATAKEYLOCATION
99 SPDKL_DefaultLocation
= 0,
100 SPDKL_CurrentUser
= 1,
101 SPDKL_LocalMachine
= 2,
102 SPDKL_CurrentConfig
= 5
105 typedef [hidden] enum SPLOADOPTIONS
111 typedef [hidden] enum SPRULESTATE
115 SPRS_ACTIVE_WITH_AUTO_PAUSE
= 3,
116 SPRS_ACTIVE_USER_DELIMITED
= 4
119 typedef [hidden] enum SPGRAMMARSTATE
126 typedef [hidden] struct SPBINARYGRAMMAR
128 ULONG ulTotalSerializedSize
;
131 typedef [hidden] struct tagSPTEXTSELECTIONINFO
133 ULONG ulStartActiveOffset
;
134 ULONG cchActiveChars
;
135 ULONG ulStartSelection
;
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
149 SPINTERFERENCE_NOISE
,
150 SPINTERFERENCE_NOSIGNAL
,
151 SPINTERFERENCE_TOOLOUD
,
152 SPINTERFERENCE_TOOQUIET
,
153 SPINTERFERENCE_TOOFAST
,
154 SPINTERFERENCE_TOOSLOW
157 typedef [hidden] enum SPVISEMES
183 typedef [hidden] enum SPEVENTENUM
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,
192 SPEI_SENTENCE_BOUNDARY
= 7,
194 SPEI_TTS_AUDIO_LEVEL
= 9,
195 SPEI_TTS_PRIVATE
= 15,
200 SPEI_END_SR_STREAM
= 34,
201 SPEI_SOUND_START
= 35,
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,
229 typedef [hidden] enum SPCONTEXTSTATE
235 typedef [hidden] enum SPVPRIORITY
242 typedef [hidden] enum SPRECOSTATE
247 SPRST_INACTIVE_WITH_PURGE
,
251 typedef [hidden] enum SPWAVEFORMATTYPE
255 } SPSTREAMFORMATTYPE
;
257 typedef [restricted, hidden] struct SPRECOCONTEXTSTATUS
259 SPINTERFERENCE eInterference
;
260 WCHAR szRequestTypeOfUI
[255];
263 } SPRECOCONTEXTSTATUS
;
265 typedef [hidden] enum 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,
282 } SPDISPLAYATTRIBUTES
;
284 typedef [hidden] enum SPBOOKMARKOPTIONS
290 typedef [hidden] enum _SPAUDIOSTATE
298 typedef [hidden] enum SPRUNSTATE
300 SPRS_DONE
= (1L << 0),
301 SPRS_IS_SPEAKING
= (1L << 1)
304 typedef [hidden] enum SPEAKFLAGS
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
)
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
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
354 typedef [hidden] enum SPSTREAMFORMAT
357 SPSF_NoAssignedFormat
= 0,
359 SPSF_NonStandardFormat
,
360 SPSF_ExtendedAudioFormat
,
364 SPSF_8kHz16BitStereo
,
366 SPSF_11kHz8BitStereo
,
368 SPSF_11kHz16BitStereo
,
370 SPSF_12kHz8BitStereo
,
372 SPSF_12kHz16BitStereo
,
374 SPSF_16kHz8BitStereo
,
376 SPSF_16kHz16BitStereo
,
378 SPSF_22kHz8BitStereo
,
380 SPSF_22kHz16BitStereo
,
382 SPSF_24kHz8BitStereo
,
384 SPSF_24kHz16BitStereo
,
386 SPSF_32kHz8BitStereo
,
388 SPSF_32kHz16BitStereo
,
390 SPSF_44kHz8BitStereo
,
392 SPSF_44kHz16BitStereo
,
394 SPSF_48kHz8BitStereo
,
396 SPSF_48kHz16BitStereo
,
397 SPSF_TrueSpeech_8kHz1BitMono
,
398 SPSF_CCITT_ALaw_8kHzMono
,
399 SPSF_CCITT_ALaw_8kHzStereo
,
400 SPSF_CCITT_ALaw_11kHzMono
,
401 SPSF_CCITT_ALaw_11kHzStereo
,
402 SPSF_CCITT_ALaw_22kHzMono
,
403 SPSF_CCITT_ALaw_22kHzStereo
,
404 SPSF_CCITT_ALaw_44kHzMono
,
405 SPSF_CCITT_ALaw_44kHzStereo
,
406 SPSF_CCITT_uLaw_8kHzMono
,
407 SPSF_CCITT_uLaw_8kHzStereo
,
408 SPSF_CCITT_uLaw_11kHzMono
,
409 SPSF_CCITT_uLaw_11kHzStereo
,
410 SPSF_CCITT_uLaw_22kHzMono
,
411 SPSF_CCITT_uLaw_22kHzStereo
,
412 SPSF_CCITT_uLaw_44kHzMono
,
413 SPSF_CCITT_uLaw_44kHzStereo
,
415 SPSF_ADPCM_8kHzStereo
,
416 SPSF_ADPCM_11kHzMono
,
417 SPSF_ADPCM_11kHzStereo
,
418 SPSF_ADPCM_22kHzMono
,
419 SPSF_ADPCM_22kHzStereo
,
420 SPSF_ADPCM_44kHzMono
,
421 SPSF_ADPCM_44kHzStereo
,
422 SPSF_GSM610_8kHzMono
,
423 SPSF_GSM610_11kHzMono
,
424 SPSF_GSM610_22kHzMono
,
425 SPSF_GSM610_44kHzMono
,
429 typedef unsigned short SPPHONEID
;
431 typedef [restricted, hidden] struct SPPHRASEELEMENT
433 ULONG ulAudioTimeOffset
;
434 ULONG ulAudioSizeTime
;
435 ULONG ulAudioStreamOffset
;
436 ULONG ulAudioSizeBytes
;
437 ULONG ulRetainedStreamOffset
;
438 ULONG ulRetainedSizeBytes
;
439 const WCHAR
*pszDisplayText
;
440 const WCHAR
*pszLexicalForm
;
441 const SPPHONEID
*pszPronunciation
;
442 BYTE bDisplayAttributes
;
443 signed char RequiredConfidence
;
444 signed char ActualConfidence
;
446 float SREngineConfidence
;
449 typedef [restricted, hidden] struct SPVOICESTATUS
451 ULONG ulCurrentStream
;
452 ULONG ulLastStreamQueued
;
453 HRESULT hrLastResult
;
454 DWORD dwRunningState
;
455 ULONG ulInputWordPos
;
456 ULONG ulInputWordLen
;
457 ULONG ulInputSentPos
;
458 ULONG ulInputSentLen
;
466 typedef [restricted, hidden] struct SPAUDIOSTATUS
468 long cbFreeBuffSpace
;
469 ULONG cbNonBlockingIO
;
471 ULONGLONG CurSeekPos
;
472 ULONGLONG CurDevicePos
;
477 typedef [restricted, hidden] struct SPRECOGNIZERSTATUS
479 SPAUDIOSTATUS AudioStatus
;
480 ULONGLONG ullRecognitionStreamPos
;
481 ULONG ulStreamNumber
;
485 LANGID aLangID
[SP_MAX_LANGIDS
];
486 ULONGLONG ullRecognitionStreamTime
;
487 } SPRECOGNIZERSTATUS
;
489 typedef [restricted, hidden] struct SPPHRASERULE SPPHRASERULE
;
495 ULONG ulFirstElement
;
496 ULONG ulCountOfElements
;
497 const SPPHRASERULE
* pNextSibling
;
498 const SPPHRASERULE
* pFirstChild
;
499 float SREngineConfidence
;
500 signed char Confidence
;
503 typedef [restricted, hidden] struct SPPHRASEPROPERTY SPPHRASEPROPERTY
;
505 struct SPPHRASEPROPERTY
507 const WCHAR
*pszName
;
509 const WCHAR
*pszValue
;
511 ULONG ulFirstElement
;
512 ULONG ulCountOfElements
;
513 const SPPHRASEPROPERTY
*pNextSibling
;
514 const SPPHRASEPROPERTY
*pFirstChild
;
515 float SREngineConfidence
;
516 signed char Confidence
;
519 typedef [restricted, hidden] struct SPPHRASEREPLACEMENT
521 BYTE bDisplayAttributes
;
522 const WCHAR
*pszReplacementText
;
523 ULONG ulFirstElement
;
524 ULONG ulCountOfElements
;
525 } SPPHRASEREPLACEMENT
;
527 typedef [restricted, hidden] struct SPPHRASE
532 ULONGLONG ullGrammarID
;
533 ULONGLONG ftStartTime
;
534 ULONGLONG ullAudioStreamPosition
;
535 ULONG ulAudioSizeBytes
;
536 ULONG ulRetainedSizeBytes
;
537 ULONG ulAudioSizeTime
;
539 const SPPHRASEPROPERTY
*pProperties
;
540 const SPPHRASEELEMENT
*pElements
;
542 const SPPHRASEREPLACEMENT
*pReplacements
;
544 ULONG ulSREnginePrivateDataSize
;
545 const BYTE *pSREnginePrivateData
;
548 typedef [restricted, hidden] struct SPSERIALIZEDPHRASE
550 ULONG ulSerializedSize
;
551 } SPSERIALIZEDPHRASE
;
553 typedef [restricted, hidden] struct SPRECORESULTTIMES
555 FILETIME ftStreamTime
;
561 typedef [hidden] enum SPFILEMODE
570 typedef [restricted, hidden] struct SPAUDIOBUFFERINFO
572 ULONG ulMsMinNotification
;
573 ULONG ulMsBufferSize
;
577 typedef [hidden] enum SPPARTOFSPEECH
579 SPPS_NotOverriden
= -1,
583 SPPS_Modifier
= 0x3000,
584 SPPS_Function
= 0x4000,
585 SPPS_Interjection
= 0x5000,
586 SPPS_Noncontent
= 0x6000,
588 SPPS_SuppressWord
= 0xF000
591 typedef [restricted, hidden] struct SPVPITCH
597 typedef [hidden] enum SPVACTIONS
608 typedef [restricted, hidden] struct SPVCONTEXT
615 typedef [restricted, hidden] struct SPVSTATE
625 SPPHONEID
*pPhoneIds
;
626 SPPARTOFSPEECH ePartOfSpeech
;
630 cpp_quote
("#if defined(__GNUC__)")
632 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 }")
633 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 }")
634 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 }")
636 cpp_quote
("#elif defined(_MSC_VER)")
638 cpp_quote
("#define SPCAT_AUDIOOUT L\"HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Speech\\\\AudioOutput\"")
639 cpp_quote
("#define SPCAT_AUDIOIN L\"HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Speech\\\\AudioInput\"")
640 cpp_quote
("#define SPCAT_VOICES L\"HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Speech\\\\Voices\"")
644 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};")
645 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};")
646 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};")
650 interface IEnumSpObjectTokens
;
651 interface ISpEventSource
;
652 interface ISpRecoContext
;
653 interface ISpRecognizer
;
654 interface ISpStreamFormat
;
659 uuid(14056581-e16c
-11d2
-bb90
-00c04f8ee6c0
),
660 helpstring("ISpDataKey"),
661 pointer_default(unique),
665 interface ISpDataKey
: IUnknown
667 HRESULT SetData
([in] LPCWSTR pszValueName
,
669 [in] const BYTE *pData
);
670 HRESULT GetData
([in] LPCWSTR pszValueName
,
673 HRESULT SetStringValue
([in] LPCWSTR pszValueName
,
674 [in] LPCWSTR pszValue
);
675 HRESULT GetStringValue
([in] LPCWSTR pszValueName
,
676 [out] LPWSTR
*ppszValue
);
677 HRESULT SetDWORD
([in] LPCWSTR pszValueName
,
679 HRESULT GetDWORD
([in] LPCWSTR pszValueName
,
680 [out] DWORD
*pdwValue
);
681 HRESULT OpenKey
([in] LPCWSTR pszSubKeyName
,
682 [out] ISpDataKey
**ppSubKey
);
683 HRESULT CreateKey
([in] LPCWSTR pszSubKey
,
684 [out] ISpDataKey
**ppSubKey
);
685 HRESULT DeleteKey
([in] LPCWSTR pszSubKey
);
686 HRESULT DeleteValue
([in] LPCWSTR pszValueName
);
687 HRESULT EnumKeys
([in] ULONG Index
,
688 [out] LPWSTR
*ppszSubKeyName
);
689 HRESULT EnumValues
([in] ULONG Index
,
690 [out] LPWSTR
*ppszValueName
);
694 uuid(92a66e2b
-c830
-4149-83df
-6fc2ba1e7a5b
),
695 helpstring("ISpRegDataKey"),
696 pointer_default(unique),
699 interface ISpRegDataKey
: ISpDataKey
701 [local] HRESULT SetKey
([in] HKEY hkey
, [in] BOOL fReadOnly
);
706 uuid(2d3d3845
-39af
-4850-bbf9
-40b49780011d
),
707 helpstring("ISpObjectTokenCategory"),
708 pointer_default(unique),
712 interface ISpObjectTokenCategory
: ISpDataKey
714 HRESULT SetId
([in] LPCWSTR pszCategoryId
,
715 [in] BOOL fCreateIfNotExist
);
716 HRESULT GetId
([out] LPWSTR
*ppszCoMemCategoryId
);
717 HRESULT GetDataKey
([in] SPDATAKEYLOCATION spdkl
,
718 [out] ISpDataKey
**ppDataKey
);
719 HRESULT EnumTokens
([in, string] LPCWSTR pszReqAttribs
,
720 [in, string] LPCWSTR pszOptAttribs
,
721 [out] IEnumSpObjectTokens
**ppEnum
);
722 HRESULT SetDefaultTokenId
([in] LPCWSTR pszTokenId
);
723 HRESULT GetDefaultTokenId
([out] LPWSTR
*ppszCoMemTokenId
);
728 uuid(14056589-e16c
-11d2
-bb90
-00c04f8ee6c0
),
729 helpstring("ISpObjectToken"),
730 pointer_default(unique),
734 interface ISpObjectToken
: ISpDataKey
736 HRESULT SetId
(/*[in]*/ LPCWSTR pszCategoryId
,
737 [in] LPCWSTR pszTokenId
,
738 [in] BOOL fCreateIfNotExist
);
739 HRESULT GetId
([out] LPWSTR
*ppszCoMemTokenId
);
740 HRESULT GetCategory
([out] ISpObjectTokenCategory
**ppTokenCategory
);
741 HRESULT CreateInstance
([in] IUnknown
*pUnkOuter
,
742 [in] DWORD dwClsContext
,
744 [out, iid_is(riid
)] void **ppvObject
);
745 HRESULT GetStorageFileName
([in] REFCLSID clsidCaller
,
746 [in] LPCWSTR pszValueName
,
747 [in, string] LPCWSTR pszFileNameSpecifier
,
749 [out] LPWSTR
*ppszFilePath
);
750 HRESULT RemoveStorageFileName
([in] REFCLSID clsidCaller
,
751 [in] LPCWSTR pszKeyName
,
752 [in] BOOL fDeleteFile
);
753 HRESULT Remove
(/*[in]*/ const CLSID
*pclsidCaller
);
754 [local] HRESULT IsUISupported
([in] LPCWSTR pszTypeOfUI
,
755 [in] void *pvExtraData
,
756 [in] ULONG cbExtraData
,
757 [in] IUnknown
*punkObject
,
758 [out] BOOL
*pfSupported
);
759 [local] HRESULT DisplayUI
([in] HWND hwndParent
,
760 [in] LPCWSTR pszTitle
,
761 [in] LPCWSTR pszTypeOfUI
,
762 [in] void *pvExtraData
,
763 [in] ULONG cbExtraData
,
764 [in] IUnknown
*punkObject
);
765 HRESULT MatchesAttributes
([in] LPCWSTR pszAttributes
,
766 [out] BOOL
*pfMatches
);
771 uuid(06b64f9e
-7fda
-11d2
-b4f2
-00c04f797396
),
772 helpstring("IEnumSpObjectTokens"),
773 pointer_default(unique),
777 interface IEnumSpObjectTokens
: IUnknown
779 HRESULT Next
([in] ULONG celt
,
780 [out, size_is(celt
), length_is(*pceltFetched
)] ISpObjectToken
**pelt
,
781 [out] ULONG
*pceltFetched
);
782 HRESULT Skip
([in] ULONG celt
);
784 HRESULT Clone
([out] IEnumSpObjectTokens
**ppEnum
);
785 HRESULT Item
([in] ULONG Index
,
786 [out] ISpObjectToken
**ppToken
);
787 HRESULT GetCount
([out] ULONG
*pCount
);
792 uuid(93384e18
-5014-43d5
-adbb
-a78e055926bd
),
793 helpstring("ISpResourceManager"),
794 pointer_default(unique),
797 interface ISpResourceManager
: IServiceProvider
799 HRESULT SetObject
([in] REFGUID guidServiceId
,
800 [in] IUnknown
*pUnkObject
);
801 HRESULT GetObject
([in] REFGUID guidServiceId
,
802 [in] REFCLSID ObjectCLSID
,
803 [in] REFIID ObjectIID
,
804 [in] BOOL fReleaseWhenLastExternalRefReleased
,
805 [out, iid_is(ObjectIID
)] void** ppObject
);
810 uuid(1a5c0354
-b621
-4b5a
-8791-d306ed379e53
),
812 pointer_default(unique),
815 interface ISpPhrase
: IUnknown
817 HRESULT GetPhrase
([out] SPPHRASE
**phrase
);
818 HRESULT GetSerializedPhrase
([out] SPSERIALIZEDPHRASE
**phrase
);
819 HRESULT GetText
([in] ULONG start
, [in] ULONG count
, [in] BOOL replacements
,
820 [out] WCHAR
**text
, [out] BYTE *attributes
);
821 HRESULT Discard
([in] DWORD types
);
826 uuid(8fcebc98
-4e49
-4067-9c6c
-d86a0e092e3d
),
828 pointer_default(unique),
831 interface ISpPhraseAlt
: ISpPhrase
833 HRESULT GetAltInfo
(ISpPhrase
**parent
, ULONG
*start
, ULONG
*count
,
840 uuid(20b053be
-e235
-43cd
-9a2a
-8d17a48b7842
),
841 pointer_default(unique),
845 interface ISpRecoResult
: ISpPhrase
847 HRESULT GetResultTimes
([out] SPRECORESULTTIMES
*times
);
849 HRESULT GetAlternates
(
853 [out] ISpPhraseAlt
**phrases
,
854 [out] ULONG
*returned
);
859 [out] ISpStreamFormat
**stream
);
864 [out] ULONG
*number
);
866 HRESULT Serialize
([out] SPSERIALIZEDRESULT
**result
);
868 HRESULT ScaleAudio
([in] const GUID
*format
, [in] const WAVEFORMATEX
*wave
);
870 HRESULT GetRecoContext
([out] ISpRecoContext
*context
);
875 uuid(8137828f
-591a
-4a42
-be58
-49ea7ebaac68
),
876 helpstring("ISpGrammarBuilder Interface"),
877 pointer_default(unique),
881 interface ISpGrammarBuilder
: IUnknown
883 HRESULT ResetGrammar
([in] LANGID language
);
885 HRESULT GetRule
([in] const WCHAR
*rule
,
887 [in] DWORD attributes
,
888 [in] BOOL should_create
,
889 [out] SPSTATEHANDLE
*state
);
890 HRESULT ClearRule
(SPSTATEHANDLE state
);
892 HRESULT CreateNewState
(
893 [in] SPSTATEHANDLE instate
,
894 [out] SPSTATEHANDLE
*outstate
);
896 HRESULT AddWordTransition
(
897 [in] SPSTATEHANDLE from_state
,
898 [in] SPSTATEHANDLE to_state
,
899 [in] const WCHAR
*value
,
900 [in] const WCHAR
*separators
,
901 [in] SPGRAMMARWORDTYPE type
,
903 [in] const SPPROPERTYINFO
*info
);
905 HRESULT AddRuleTransition
(
906 [in] SPSTATEHANDLE from_state
,
907 [in] SPSTATEHANDLE to_state
,
908 [in] SPSTATEHANDLE rule
,
910 [in] const SPPROPERTYINFO
*info
);
912 HRESULT AddResource
([in] SPSTATEHANDLE state
,
913 [in] const WCHAR
*name
,
914 [in] const WCHAR
*value
);
916 HRESULT Commit
([in] DWORD reserved
);
921 uuid(2177db29
-7f45
-47d0
-8554-067e91c80502
),
922 pointer_default(unique),
926 interface ISpRecoGrammar
: ISpGrammarBuilder
928 HRESULT GetGrammarId
([out] ULONGLONG
*grammar
);
929 HRESULT GetRecoContext
([out] ISpRecoContext
**context
);
931 HRESULT LoadCmdFromFile
([in, string] const WCHAR
* pszFileName
, [in] SPLOADOPTIONS options
);
932 HRESULT LoadCmdFromObject
([in] REFCLSID rcid
, [in, string] const WCHAR
* pszGrammarName
, [in] SPLOADOPTIONS options
);
933 HRESULT LoadCmdFromResource
([in] HMODULE hmod
,
934 [in, string] const WCHAR
*name
,
935 [in, string] const WCHAR
*type
,
937 [in] SPLOADOPTIONS options
);
938 HRESULT LoadCmdFromMemory
([in] const SPBINARYGRAMMAR
*grammar
, [in] SPLOADOPTIONS options
);
939 HRESULT LoadCmdFromProprietaryGrammar
(
941 [in, string] const WCHAR
*param
,
942 [in] const void *data
,
944 [in] SPLOADOPTIONS options
);
945 HRESULT SetRuleState
([in, string] const WCHAR
*name
, [in] void *reserved
,
946 [in] SPRULESTATE state
);
947 HRESULT SetRuleIdState
([in] ULONG rule
, [in] SPRULESTATE state
);
949 HRESULT LoadDictation
([in, string] const WCHAR
*name
, [in] SPLOADOPTIONS options
);
950 HRESULT UnloadDictation
();
951 HRESULT SetDictationState
([in] SPRULESTATE state
);
953 HRESULT SetWordSequenceData
([in] const WCHAR
*text
, [in] ULONG count
, [in] const SPTEXTSELECTIONINFO
*info
);
954 HRESULT SetTextSelection
([in] const SPTEXTSELECTIONINFO
*info
);
956 HRESULT IsPronounceable
([in, string] const WCHAR
*word
, [out] SPWORDPRONOUNCEABLE
*pronounceable
);
958 HRESULT SetGrammarState
([in] SPGRAMMARSTATE state
);
960 HRESULT SaveCmd
([in] IStream
*stream
, [out, optional] WCHAR
**error
);
962 HRESULT GetGrammarState
([out] SPGRAMMARSTATE
*state
);
967 uuid(259684dc
-37c3
-11d2
-9603-00c04f8ee628
),
968 pointer_default(unique),
971 interface ISpNotifySink
: IUnknown
973 HRESULT Notify
(void);
978 uuid(5eff4aef
-8487-11d2
-961c
-00c04f8ee628
),
979 pointer_default(unique),
982 interface ISpNotifySource
: IUnknown
984 HRESULT SetNotifySink
([in] ISpNotifySink
*sink
);
985 [local] HRESULT SetNotifyWindowMessage
(
990 [local] HRESULT SetNotifyCallbackFunction
(
991 [in] SPNOTIFYCALLBACK
*callback,
994 [local] HRESULT SetNotifyCallbackInterface
(
995 [in] ISpNotifyCallback
*callback,
998 [local] HRESULT SetNotifyWin32Event
(void);
999 [local] HRESULT WaitForNotifyEvent
([in] DWORD milliseconds
);
1000 [local] HANDLE GetNotifyEventHandle
();
1005 uuid(be7a9cce
-5f9e
-11d2
-960f
-00c04f8ee628
),
1006 pointer_default(unique),
1010 interface ISpEventSource
: ISpNotifySource
1012 HRESULT SetInterest
([in] ULONGLONG event
, [in] ULONGLONG queued
);
1013 HRESULT GetEvents
([in] ULONG count
,
1014 [out, size_is(count
)] SPEVENT
*array
,
1015 [out] ULONG
*fetched
);
1016 HRESULT GetInfo
([out] SPEVENTSOURCEINFO
*info
);
1021 uuid(f740a62f
-7c15
-489e-8234-940a33d9272d
),
1022 pointer_default(unique),
1026 interface ISpRecoContext
: ISpEventSource
1028 HRESULT GetRecognizer
([out] ISpRecognizer
**recognizer
);
1030 HRESULT CreateGrammar
([in] ULONGLONG grammar
, [out] ISpRecoGrammar
**spgrammar
);
1032 HRESULT GetStatus
([out] SPRECOCONTEXTSTATUS
*status
);
1034 HRESULT GetMaxAlternates
([in] ULONG
*alternates
);
1035 HRESULT SetMaxAlternates
([in] ULONG alternates
);
1037 HRESULT SetAudioOptions
([in] SPAUDIOOPTIONS options
, [in] const GUID
*format
, [in] const WAVEFORMATEX
*wave
);
1038 HRESULT GetAudioOptions
([in] SPAUDIOOPTIONS
*options
, [out] GUID
*format
, [out] WAVEFORMATEX
**wave
);
1040 HRESULT DeserializeResult
([in] const SPSERIALIZEDRESULT
*serialized
, [out] ISpRecoResult
**result
);
1042 HRESULT Bookmark
([in] SPBOOKMARKOPTIONS options
, [in] ULONGLONG position
, [in] LPARAM event
);
1044 HRESULT SetAdaptationData
([in, string] const WCHAR
*data
, [in] const ULONG count
);
1046 HRESULT Pause
(DWORD reserved
);
1047 HRESULT Resume
(DWORD reserved
);
1049 HRESULT SetVoice
([in] ISpVoice
*voice
, [in] BOOL changes
);
1050 HRESULT GetVoice
([out] ISpVoice
**voice
);
1051 HRESULT SetVoicePurgeEvent
([in] ULONGLONG interest
);
1052 HRESULT GetVoicePurgeEvent
([out] ULONGLONG
*interest
);
1054 HRESULT SetContextState
([in] SPCONTEXTSTATE state
);
1055 HRESULT GetContextState
([in] SPCONTEXTSTATE
*state
);
1060 uuid(6c44df74
-72b9
-4992-a1ec
-ef996e0422d4
),
1061 pointer_default(unique),
1064 interface ISpVoice
: ISpEventSource
1066 HRESULT SetOutput
([in] IUnknown
*unk
, [in] BOOL changes
);
1067 HRESULT GetOutputObjectToken
([out] ISpObjectToken
**token
);
1068 HRESULT GetOutputStream
([out] ISpStreamFormat
**stream
);
1070 HRESULT Pause
(void);
1071 HRESULT Resume
(void);
1073 HRESULT SetVoice
([in] ISpObjectToken
*token
);
1074 HRESULT GetVoice
([out] ISpObjectToken
**token
);
1076 HRESULT Speak
([in, string] const WCHAR
*pwcs
,
1078 [out] ULONG
*number
);
1079 HRESULT SpeakStream
([in] IStream
*stream
,
1081 [out] ULONG
*number
);
1084 [out] SPVOICESTATUS
*status
,
1085 [out, string] WCHAR
**bookmark
);
1087 HRESULT Skip
([in,string] const WCHAR
*type
, [in] long items
, [out] ULONG
*skipped
);
1089 HRESULT SetPriority
([in] SPVPRIORITY priority
);
1090 HRESULT GetPriority
([out] SPVPRIORITY
* priority
);
1092 HRESULT SetAlertBoundary
([in] SPEVENTENUM boundary
);
1093 HRESULT GetAlertBoundary
([out] SPEVENTENUM
* boundary
);
1095 HRESULT SetRate
([in] long adjust
);
1096 HRESULT GetRate
([out] long *adjust
);
1098 HRESULT SetVolume
([in] USHORT volume
);
1099 HRESULT GetVolume
([out] USHORT
*volume
);
1101 HRESULT WaitUntilDone
([in] ULONG timeout
);
1103 HRESULT SetSyncSpeakTimeout
([in] ULONG timeout
);
1104 HRESULT GetSyncSpeakTimeout
([out] ULONG
*timeout
);
1106 [local] HANDLE SpeakCompleteEvent
();
1108 [local] HRESULT IsUISupported
(
1109 [in] const WCHAR
*type
,
1112 [out] BOOL
*supported
);
1113 [local] HRESULT DisplayUI
(
1115 [in] const WCHAR
*title
,
1116 [in] const WCHAR
*type
,
1123 uuid(be7a9cc9
-5f9e
-11d2
-960f
-00c04f8ee628
),
1124 pointer_default(unique),
1128 interface ISpEventSink
: IUnknown
1130 HRESULT AddEvents
([in] const SPEVENT
*events
, [in] ULONG count
);
1131 HRESULT GetEventInterest
([out] ULONGLONG
*interest
);
1136 uuid(5b559f40
-e952
-11d2
-bb91
-00c04f8ee6c0
),
1137 pointer_default(unique),
1140 interface ISpObjectWithToken
: IUnknown
1142 HRESULT SetObjectToken
([in] ISpObjectToken
*token
);
1143 HRESULT GetObjectToken
([out] ISpObjectToken
**token
);
1148 uuid(bed530be
-2606-4f4d
-a1c0
-54c5cda5566f
),
1149 pointer_default(unique),
1152 interface ISpStreamFormat
: IStream
1154 HRESULT GetFormat
(GUID
*format
, WAVEFORMATEX
**wave
);
1159 uuid(c05c768f
-fae8
-4ec2
-8e07
-338321c12452
),
1160 pointer_default(unique),
1164 interface ISpAudio
: ISpStreamFormat
1166 HRESULT SetState
([in] SPAUDIOSTATE state
, [in] ULONGLONG reserved
);
1167 HRESULT SetFormat
([in] REFGUID guid
, [in] const WAVEFORMATEX
*wave
);
1168 HRESULT GetStatus
([out] SPAUDIOSTATUS
*status
);
1169 HRESULT SetBufferInfo
([in] const SPAUDIOBUFFERINFO
*buffer
);
1170 HRESULT GetBufferInfo
([out] SPAUDIOBUFFERINFO
*buffer
);
1171 HRESULT GetDefaultFormat
([out] GUID
*guid
, [out] WAVEFORMATEX
**wave
);
1172 HANDLE EventHandle
();
1173 HRESULT GetVolumeLevel
([out] ULONG
*level
);
1174 HRESULT SetVolumeLevel
([in] ULONG level
);
1175 HRESULT GetBufferNotifySize
([out] ULONG
*size
);
1176 HRESULT SetBufferNotifySize
([in] ULONG size
);
1180 uuid(15806f6e
-1d70
-4b48
-98e6
-3b1a007509ab
),
1181 pointer_default(unique),
1185 interface ISpMMSysAudio
: ISpAudio
1187 HRESULT GetDeviceId
([out] UINT
*id);
1188 HRESULT SetDeviceId
([in] UINT
id);
1189 HRESULT GetMMHandle
([out] void **handle);
1190 HRESULT GetLineId
([out] UINT
*id);
1191 HRESULT SetLineId
([in] UINT
id);
1196 uuid(5b4fb971
-b115
-4de1
-ad97
-e482e3bf6ee4
),
1197 pointer_default(unique),
1201 interface ISpProperties
: IUnknown
1203 HRESULT SetPropertyNum
([in] const WCHAR
*name
, [in] long value
);
1204 HRESULT GetPropertyNum
([in] const WCHAR
*name
, [out] long *value
);
1205 HRESULT SetPropertyString
([in] const WCHAR
*name
, [in] const WCHAR
*value
);
1206 HRESULT GetPropertyString
([in] const WCHAR
*name
, [out] WCHAR
**value
);
1211 uuid(c2b5f241
-daa0
-4507-9e16
-5a1eaa2b7a5c
),
1212 pointer_default(unique),
1215 interface ISpRecognizer
: ISpProperties
1217 HRESULT SetRecognizer
([in] ISpObjectToken
*recognizer
);
1218 HRESULT GetRecognizer
([out] ISpObjectToken
**recognizer
);
1220 HRESULT SetInput
([in] IUnknown
*input
, [in] BOOL changes
);
1221 HRESULT GetInputObjectToken
([out] ISpObjectToken
**token
);
1223 HRESULT GetInputStream
( [out] ISpStreamFormat
**stream
);
1224 HRESULT CreateRecoContext
([out] ISpRecoContext
**cxt
);
1226 HRESULT GetRecoProfile
([out] ISpObjectToken
**token
);
1227 HRESULT SetRecoProfile
([in] ISpObjectToken
*token
);
1229 HRESULT IsSharedInstance
(void);
1231 HRESULT GetRecoState
([out] SPRECOSTATE
*state
);
1232 HRESULT SetRecoState
([in] SPRECOSTATE state
);
1234 HRESULT GetStatus
([out] SPRECOGNIZERSTATUS
*status
);
1235 HRESULT GetFormat
([in] SPSTREAMFORMATTYPE type
, [out] GUID
*format
, [out] WAVEFORMATEX
**wave
);
1237 [local] HRESULT IsUISupported
([in] const WCHAR
*type
, [in] void *extra
, [in] ULONG count
,
1238 [out] BOOL
*supported
);
1239 [local] HRESULT DisplayUI
([in] HWND hwnd
,[in] const WCHAR
*title
, [in] const WCHAR
*type
,
1240 [in] void *extra
, [in] ULONG cnt
);
1241 HRESULT EmulateRecognition
([in] ISpPhrase
*phrase
);
1246 uuid(12e3cca9
-7518-44c5
-a5e7
-ba5a79cb929e
),
1247 pointer_default(unique),
1251 interface ISpStream
: ISpStreamFormat
1253 HRESULT SetBaseStream
([in] IStream
*stream
, [in] REFGUID format
, [in] const WAVEFORMATEX
*wave
);
1254 HRESULT GetBaseStream
([out] IStream
**stream
);
1255 HRESULT BindToFile
([in] LPCWSTR filename
, [in] SPFILEMODE mode
, [in] const GUID
*format
,
1256 const WAVEFORMATEX
*wave
, [in] ULONGLONG interest
);
1261 helpstring("Speech Object Library"),
1262 uuid(c866ca3a
-32f7
-11d2
-9602-00c04f8ee628
),
1267 importlib
("stdole2.tlb");
1269 #include
"sapiaut.idl"
1272 uuid(a910187f
-0c7a
-45ac
-92cc
-59edafb77b53
),
1273 helpstring("SpObjectTokenCategory Class"),
1274 progid
("SAPI.SpObjectTokenCategory.1"),
1275 vi_progid
("SAPI.SpObjectTokenCategory"),
1278 coclass SpObjectTokenCategory
1280 interface ISpObjectTokenCategory
;
1284 uuid(ef411752
-3736-4cb4
-9c8c
-8ef4ccb58efe
),
1285 helpstring("Object Token"),
1286 progid
("SAPI.SpObjectToken.1"),
1287 vi_progid
("SAPI.SpObjectToken"),
1290 coclass SpObjectToken
1292 interface ISpObjectToken
;
1293 [default] interface ISpDataKey
;
1297 uuid(96749373-3391-11d2
-9ee3
-00c04f797396
),
1298 helpstring("Resource Manager"),
1299 progid
("SAPI.SpResourceManager.1"),
1300 vi_progid
("SAPI.SpResourceManager"),
1305 coclass SpResourceManager
1307 [default] interface ISpResourceManager
;
1311 uuid(3bee4890
-4fe9
-4a37
-8c1e
-5e7e12791c1f
)
1313 coclass SpSharedRecognizer
1315 /*[default] interface ISpeechRecognizer;*/
1316 interface ISpRecognizer
;
1320 uuid(715d9c59
-4442-11d2
-9605-00c04f8ee628
),
1321 helpstring("Speech Stream"),
1322 progid
("SAPI.SpStream.1"),
1323 vi_progid
("SAPI.SpStream"),
1330 interface ISpStream
;
1334 uuid(96749377-3391-11d2
-9ee3
-00c04f797396
)
1339 [default] interface ISpeechVoice
;
1343 uuid(947812b3
-2ae1
-4644-ba86
-9e90ded7ec91
),
1345 coclass SpFileStream
1347 interface ISpStream
;
1348 [default] interface ISpeechFileStream
;
1352 uuid(ab1890a0
-e91f
-11d2
-bb91
-00c04f8ee6c0
),
1356 coclass SpMMAudioEnum
1358 interface IEnumSpObjectTokens
;
1362 uuid(cf3d2e50
-53f2
-11d2
-960c
-00c04f8ee628
)
1366 interface ISpEventSource
;
1367 interface ISpEventSink
;
1368 interface ISpObjectWithToken
;
1369 interface ISpMMSysAudio
;
1373 uuid(a8c680eb
-3d32
-11d2
-9ee7
-00c04f797396
)
1375 coclass SpMMAudioOut
1377 interface ISpEventSource
;
1378 interface ISpEventSink
;
1379 interface ISpObjectWithToken
;
1380 interface ISpMMSysAudio
;