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 cpp_quote
("EXTERN_C const GUID SPDFID_Text;")
430 cpp_quote
("EXTERN_C const GUID SPDFID_WaveFormatEx;")
432 typedef unsigned short SPPHONEID
;
434 typedef [restricted, hidden] struct SPPHRASEELEMENT
436 ULONG ulAudioTimeOffset
;
437 ULONG ulAudioSizeTime
;
438 ULONG ulAudioStreamOffset
;
439 ULONG ulAudioSizeBytes
;
440 ULONG ulRetainedStreamOffset
;
441 ULONG ulRetainedSizeBytes
;
442 const WCHAR
*pszDisplayText
;
443 const WCHAR
*pszLexicalForm
;
444 const SPPHONEID
*pszPronunciation
;
445 BYTE bDisplayAttributes
;
446 signed char RequiredConfidence
;
447 signed char ActualConfidence
;
449 float SREngineConfidence
;
452 typedef [restricted, hidden] struct SPVOICESTATUS
454 ULONG ulCurrentStream
;
455 ULONG ulLastStreamQueued
;
456 HRESULT hrLastResult
;
457 DWORD dwRunningState
;
458 ULONG ulInputWordPos
;
459 ULONG ulInputWordLen
;
460 ULONG ulInputSentPos
;
461 ULONG ulInputSentLen
;
469 typedef [restricted, hidden] struct SPAUDIOSTATUS
471 long cbFreeBuffSpace
;
472 ULONG cbNonBlockingIO
;
474 ULONGLONG CurSeekPos
;
475 ULONGLONG CurDevicePos
;
480 typedef [restricted, hidden] struct SPRECOGNIZERSTATUS
482 SPAUDIOSTATUS AudioStatus
;
483 ULONGLONG ullRecognitionStreamPos
;
484 ULONG ulStreamNumber
;
488 LANGID aLangID
[SP_MAX_LANGIDS
];
489 ULONGLONG ullRecognitionStreamTime
;
490 } SPRECOGNIZERSTATUS
;
492 typedef [restricted, hidden] struct SPPHRASERULE SPPHRASERULE
;
498 ULONG ulFirstElement
;
499 ULONG ulCountOfElements
;
500 const SPPHRASERULE
* pNextSibling
;
501 const SPPHRASERULE
* pFirstChild
;
502 float SREngineConfidence
;
503 signed char Confidence
;
506 typedef [restricted, hidden] struct SPPHRASEPROPERTY SPPHRASEPROPERTY
;
508 struct SPPHRASEPROPERTY
510 const WCHAR
*pszName
;
512 const WCHAR
*pszValue
;
514 ULONG ulFirstElement
;
515 ULONG ulCountOfElements
;
516 const SPPHRASEPROPERTY
*pNextSibling
;
517 const SPPHRASEPROPERTY
*pFirstChild
;
518 float SREngineConfidence
;
519 signed char Confidence
;
522 typedef [restricted, hidden] struct SPPHRASEREPLACEMENT
524 BYTE bDisplayAttributes
;
525 const WCHAR
*pszReplacementText
;
526 ULONG ulFirstElement
;
527 ULONG ulCountOfElements
;
528 } SPPHRASEREPLACEMENT
;
530 typedef [restricted, hidden] struct SPPHRASE
535 ULONGLONG ullGrammarID
;
536 ULONGLONG ftStartTime
;
537 ULONGLONG ullAudioStreamPosition
;
538 ULONG ulAudioSizeBytes
;
539 ULONG ulRetainedSizeBytes
;
540 ULONG ulAudioSizeTime
;
542 const SPPHRASEPROPERTY
*pProperties
;
543 const SPPHRASEELEMENT
*pElements
;
545 const SPPHRASEREPLACEMENT
*pReplacements
;
547 ULONG ulSREnginePrivateDataSize
;
548 const BYTE *pSREnginePrivateData
;
551 typedef [restricted, hidden] struct SPSERIALIZEDPHRASE
553 ULONG ulSerializedSize
;
554 } SPSERIALIZEDPHRASE
;
556 typedef [restricted, hidden] struct SPRECORESULTTIMES
558 FILETIME ftStreamTime
;
564 typedef [hidden] enum SPFILEMODE
573 typedef [restricted, hidden] struct SPAUDIOBUFFERINFO
575 ULONG ulMsMinNotification
;
576 ULONG ulMsBufferSize
;
580 typedef [hidden] enum SPPARTOFSPEECH
582 SPPS_NotOverriden
= -1,
586 SPPS_Modifier
= 0x3000,
587 SPPS_Function
= 0x4000,
588 SPPS_Interjection
= 0x5000,
589 SPPS_Noncontent
= 0x6000,
591 SPPS_SuppressWord
= 0xF000
594 typedef [restricted, hidden] struct SPVPITCH
600 typedef [hidden] enum SPVACTIONS
611 typedef [restricted, hidden] struct SPVCONTEXT
618 typedef [restricted, hidden] struct SPVSTATE
628 SPPHONEID
*pPhoneIds
;
629 SPPARTOFSPEECH ePartOfSpeech
;
633 cpp_quote
("#if defined(__GNUC__)")
635 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 }")
636 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 }")
637 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 }")
639 cpp_quote
("#elif defined(_MSC_VER)")
641 cpp_quote
("#define SPCAT_AUDIOOUT L\"HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Speech\\\\AudioOutput\"")
642 cpp_quote
("#define SPCAT_AUDIOIN L\"HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Speech\\\\AudioInput\"")
643 cpp_quote
("#define SPCAT_VOICES L\"HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Speech\\\\Voices\"")
647 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};")
648 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};")
649 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};")
653 interface IEnumSpObjectTokens
;
654 interface ISpEventSource
;
655 interface ISpRecoContext
;
656 interface ISpRecognizer
;
657 interface ISpStreamFormat
;
662 uuid(14056581-e16c
-11d2
-bb90
-00c04f8ee6c0
),
663 helpstring("ISpDataKey"),
664 pointer_default(unique),
668 interface ISpDataKey
: IUnknown
670 HRESULT SetData
([in] LPCWSTR pszValueName
,
672 [in] const BYTE *pData
);
673 HRESULT GetData
([in] LPCWSTR pszValueName
,
676 HRESULT SetStringValue
([in] LPCWSTR pszValueName
,
677 [in] LPCWSTR pszValue
);
678 HRESULT GetStringValue
([in] LPCWSTR pszValueName
,
679 [out] LPWSTR
*ppszValue
);
680 HRESULT SetDWORD
([in] LPCWSTR pszValueName
,
682 HRESULT GetDWORD
([in] LPCWSTR pszValueName
,
683 [out] DWORD
*pdwValue
);
684 HRESULT OpenKey
([in] LPCWSTR pszSubKeyName
,
685 [out] ISpDataKey
**ppSubKey
);
686 HRESULT CreateKey
([in] LPCWSTR pszSubKey
,
687 [out] ISpDataKey
**ppSubKey
);
688 HRESULT DeleteKey
([in] LPCWSTR pszSubKey
);
689 HRESULT DeleteValue
([in] LPCWSTR pszValueName
);
690 HRESULT EnumKeys
([in] ULONG Index
,
691 [out] LPWSTR
*ppszSubKeyName
);
692 HRESULT EnumValues
([in] ULONG Index
,
693 [out] LPWSTR
*ppszValueName
);
697 uuid(92a66e2b
-c830
-4149-83df
-6fc2ba1e7a5b
),
698 helpstring("ISpRegDataKey"),
699 pointer_default(unique),
702 interface ISpRegDataKey
: ISpDataKey
704 [local] HRESULT SetKey
([in] HKEY hkey
, [in] BOOL fReadOnly
);
709 uuid(2d3d3845
-39af
-4850-bbf9
-40b49780011d
),
710 helpstring("ISpObjectTokenCategory"),
711 pointer_default(unique),
715 interface ISpObjectTokenCategory
: ISpDataKey
717 HRESULT SetId
([in] LPCWSTR pszCategoryId
,
718 [in] BOOL fCreateIfNotExist
);
719 HRESULT GetId
([out] LPWSTR
*ppszCoMemCategoryId
);
720 HRESULT GetDataKey
([in] SPDATAKEYLOCATION spdkl
,
721 [out] ISpDataKey
**ppDataKey
);
722 HRESULT EnumTokens
([in, string] LPCWSTR pszReqAttribs
,
723 [in, string] LPCWSTR pszOptAttribs
,
724 [out] IEnumSpObjectTokens
**ppEnum
);
725 HRESULT SetDefaultTokenId
([in] LPCWSTR pszTokenId
);
726 HRESULT GetDefaultTokenId
([out] LPWSTR
*ppszCoMemTokenId
);
731 uuid(14056589-e16c
-11d2
-bb90
-00c04f8ee6c0
),
732 helpstring("ISpObjectToken"),
733 pointer_default(unique),
737 interface ISpObjectToken
: ISpDataKey
739 HRESULT SetId
(/*[in]*/ LPCWSTR pszCategoryId
,
740 [in] LPCWSTR pszTokenId
,
741 [in] BOOL fCreateIfNotExist
);
742 HRESULT GetId
([out] LPWSTR
*ppszCoMemTokenId
);
743 HRESULT GetCategory
([out] ISpObjectTokenCategory
**ppTokenCategory
);
744 HRESULT CreateInstance
([in] IUnknown
*pUnkOuter
,
745 [in] DWORD dwClsContext
,
747 [out, iid_is(riid
)] void **ppvObject
);
748 HRESULT GetStorageFileName
([in] REFCLSID clsidCaller
,
749 [in] LPCWSTR pszValueName
,
750 [in, string] LPCWSTR pszFileNameSpecifier
,
752 [out] LPWSTR
*ppszFilePath
);
753 HRESULT RemoveStorageFileName
([in] REFCLSID clsidCaller
,
754 [in] LPCWSTR pszKeyName
,
755 [in] BOOL fDeleteFile
);
756 HRESULT Remove
(/*[in]*/ const CLSID
*pclsidCaller
);
757 [local] HRESULT IsUISupported
([in] LPCWSTR pszTypeOfUI
,
758 [in] void *pvExtraData
,
759 [in] ULONG cbExtraData
,
760 [in] IUnknown
*punkObject
,
761 [out] BOOL
*pfSupported
);
762 [local] HRESULT DisplayUI
([in] HWND hwndParent
,
763 [in] LPCWSTR pszTitle
,
764 [in] LPCWSTR pszTypeOfUI
,
765 [in] void *pvExtraData
,
766 [in] ULONG cbExtraData
,
767 [in] IUnknown
*punkObject
);
768 HRESULT MatchesAttributes
([in] LPCWSTR pszAttributes
,
769 [out] BOOL
*pfMatches
);
774 uuid(06b64f9e
-7fda
-11d2
-b4f2
-00c04f797396
),
775 helpstring("IEnumSpObjectTokens"),
776 pointer_default(unique),
780 interface IEnumSpObjectTokens
: IUnknown
782 HRESULT Next
([in] ULONG celt
,
783 [out, size_is(celt
), length_is(*pceltFetched
)] ISpObjectToken
**pelt
,
784 [out] ULONG
*pceltFetched
);
785 HRESULT Skip
([in] ULONG celt
);
787 HRESULT Clone
([out] IEnumSpObjectTokens
**ppEnum
);
788 HRESULT Item
([in] ULONG Index
,
789 [out] ISpObjectToken
**ppToken
);
790 HRESULT GetCount
([out] ULONG
*pCount
);
795 uuid(93384e18
-5014-43d5
-adbb
-a78e055926bd
),
796 helpstring("ISpResourceManager"),
797 pointer_default(unique),
800 interface ISpResourceManager
: IServiceProvider
802 HRESULT SetObject
([in] REFGUID guidServiceId
,
803 [in] IUnknown
*pUnkObject
);
804 HRESULT GetObject
([in] REFGUID guidServiceId
,
805 [in] REFCLSID ObjectCLSID
,
806 [in] REFIID ObjectIID
,
807 [in] BOOL fReleaseWhenLastExternalRefReleased
,
808 [out, iid_is(ObjectIID
)] void** ppObject
);
813 uuid(1a5c0354
-b621
-4b5a
-8791-d306ed379e53
),
815 pointer_default(unique),
818 interface ISpPhrase
: IUnknown
820 HRESULT GetPhrase
([out] SPPHRASE
**phrase
);
821 HRESULT GetSerializedPhrase
([out] SPSERIALIZEDPHRASE
**phrase
);
822 HRESULT GetText
([in] ULONG start
, [in] ULONG count
, [in] BOOL replacements
,
823 [out] WCHAR
**text
, [out] BYTE *attributes
);
824 HRESULT Discard
([in] DWORD types
);
829 uuid(8fcebc98
-4e49
-4067-9c6c
-d86a0e092e3d
),
831 pointer_default(unique),
834 interface ISpPhraseAlt
: ISpPhrase
836 HRESULT GetAltInfo
(ISpPhrase
**parent
, ULONG
*start
, ULONG
*count
,
843 uuid(20b053be
-e235
-43cd
-9a2a
-8d17a48b7842
),
844 pointer_default(unique),
848 interface ISpRecoResult
: ISpPhrase
850 HRESULT GetResultTimes
([out] SPRECORESULTTIMES
*times
);
852 HRESULT GetAlternates
(
856 [out] ISpPhraseAlt
**phrases
,
857 [out] ULONG
*returned
);
862 [out] ISpStreamFormat
**stream
);
867 [out] ULONG
*number
);
869 HRESULT Serialize
([out] SPSERIALIZEDRESULT
**result
);
871 HRESULT ScaleAudio
([in] const GUID
*format
, [in] const WAVEFORMATEX
*wave
);
873 HRESULT GetRecoContext
([out] ISpRecoContext
*context
);
878 uuid(8137828f
-591a
-4a42
-be58
-49ea7ebaac68
),
879 helpstring("ISpGrammarBuilder Interface"),
880 pointer_default(unique),
884 interface ISpGrammarBuilder
: IUnknown
886 HRESULT ResetGrammar
([in] LANGID language
);
888 HRESULT GetRule
([in] const WCHAR
*rule
,
890 [in] DWORD attributes
,
891 [in] BOOL should_create
,
892 [out] SPSTATEHANDLE
*state
);
893 HRESULT ClearRule
(SPSTATEHANDLE state
);
895 HRESULT CreateNewState
(
896 [in] SPSTATEHANDLE instate
,
897 [out] SPSTATEHANDLE
*outstate
);
899 HRESULT AddWordTransition
(
900 [in] SPSTATEHANDLE from_state
,
901 [in] SPSTATEHANDLE to_state
,
902 [in] const WCHAR
*value
,
903 [in] const WCHAR
*separators
,
904 [in] SPGRAMMARWORDTYPE type
,
906 [in] const SPPROPERTYINFO
*info
);
908 HRESULT AddRuleTransition
(
909 [in] SPSTATEHANDLE from_state
,
910 [in] SPSTATEHANDLE to_state
,
911 [in] SPSTATEHANDLE rule
,
913 [in] const SPPROPERTYINFO
*info
);
915 HRESULT AddResource
([in] SPSTATEHANDLE state
,
916 [in] const WCHAR
*name
,
917 [in] const WCHAR
*value
);
919 HRESULT Commit
([in] DWORD reserved
);
924 uuid(2177db29
-7f45
-47d0
-8554-067e91c80502
),
925 pointer_default(unique),
929 interface ISpRecoGrammar
: ISpGrammarBuilder
931 HRESULT GetGrammarId
([out] ULONGLONG
*grammar
);
932 HRESULT GetRecoContext
([out] ISpRecoContext
**context
);
934 HRESULT LoadCmdFromFile
([in, string] const WCHAR
* pszFileName
, [in] SPLOADOPTIONS options
);
935 HRESULT LoadCmdFromObject
([in] REFCLSID rcid
, [in, string] const WCHAR
* pszGrammarName
, [in] SPLOADOPTIONS options
);
936 HRESULT LoadCmdFromResource
([in] HMODULE hmod
,
937 [in, string] const WCHAR
*name
,
938 [in, string] const WCHAR
*type
,
940 [in] SPLOADOPTIONS options
);
941 HRESULT LoadCmdFromMemory
([in] const SPBINARYGRAMMAR
*grammar
, [in] SPLOADOPTIONS options
);
942 HRESULT LoadCmdFromProprietaryGrammar
(
944 [in, string] const WCHAR
*param
,
945 [in] const void *data
,
947 [in] SPLOADOPTIONS options
);
948 HRESULT SetRuleState
([in, string] const WCHAR
*name
, [in] void *reserved
,
949 [in] SPRULESTATE state
);
950 HRESULT SetRuleIdState
([in] ULONG rule
, [in] SPRULESTATE state
);
952 HRESULT LoadDictation
([in, string] const WCHAR
*name
, [in] SPLOADOPTIONS options
);
953 HRESULT UnloadDictation
();
954 HRESULT SetDictationState
([in] SPRULESTATE state
);
956 HRESULT SetWordSequenceData
([in] const WCHAR
*text
, [in] ULONG count
, [in] const SPTEXTSELECTIONINFO
*info
);
957 HRESULT SetTextSelection
([in] const SPTEXTSELECTIONINFO
*info
);
959 HRESULT IsPronounceable
([in, string] const WCHAR
*word
, [out] SPWORDPRONOUNCEABLE
*pronounceable
);
961 HRESULT SetGrammarState
([in] SPGRAMMARSTATE state
);
963 HRESULT SaveCmd
([in] IStream
*stream
, [out, optional] WCHAR
**error
);
965 HRESULT GetGrammarState
([out] SPGRAMMARSTATE
*state
);
970 uuid(259684dc
-37c3
-11d2
-9603-00c04f8ee628
),
971 pointer_default(unique),
974 interface ISpNotifySink
: IUnknown
976 HRESULT Notify
(void);
981 uuid(5eff4aef
-8487-11d2
-961c
-00c04f8ee628
),
982 pointer_default(unique),
985 interface ISpNotifySource
: IUnknown
987 HRESULT SetNotifySink
([in] ISpNotifySink
*sink
);
988 [local] HRESULT SetNotifyWindowMessage
(
993 [local] HRESULT SetNotifyCallbackFunction
(
994 [in] SPNOTIFYCALLBACK
*callback,
997 [local] HRESULT SetNotifyCallbackInterface
(
998 [in] ISpNotifyCallback
*callback,
1000 [in] LPARAM lparam
);
1001 [local] HRESULT SetNotifyWin32Event
(void);
1002 [local] HRESULT WaitForNotifyEvent
([in] DWORD milliseconds
);
1003 [local] HANDLE GetNotifyEventHandle
();
1008 uuid(be7a9cce
-5f9e
-11d2
-960f
-00c04f8ee628
),
1009 pointer_default(unique),
1013 interface ISpEventSource
: ISpNotifySource
1015 HRESULT SetInterest
([in] ULONGLONG event
, [in] ULONGLONG queued
);
1016 HRESULT GetEvents
([in] ULONG count
,
1017 [out, size_is(count
)] SPEVENT
*array
,
1018 [out] ULONG
*fetched
);
1019 HRESULT GetInfo
([out] SPEVENTSOURCEINFO
*info
);
1024 uuid(f740a62f
-7c15
-489e-8234-940a33d9272d
),
1025 pointer_default(unique),
1029 interface ISpRecoContext
: ISpEventSource
1031 HRESULT GetRecognizer
([out] ISpRecognizer
**recognizer
);
1033 HRESULT CreateGrammar
([in] ULONGLONG grammar
, [out] ISpRecoGrammar
**spgrammar
);
1035 HRESULT GetStatus
([out] SPRECOCONTEXTSTATUS
*status
);
1037 HRESULT GetMaxAlternates
([in] ULONG
*alternates
);
1038 HRESULT SetMaxAlternates
([in] ULONG alternates
);
1040 HRESULT SetAudioOptions
([in] SPAUDIOOPTIONS options
, [in] const GUID
*format
, [in] const WAVEFORMATEX
*wave
);
1041 HRESULT GetAudioOptions
([in] SPAUDIOOPTIONS
*options
, [out] GUID
*format
, [out] WAVEFORMATEX
**wave
);
1043 HRESULT DeserializeResult
([in] const SPSERIALIZEDRESULT
*serialized
, [out] ISpRecoResult
**result
);
1045 HRESULT Bookmark
([in] SPBOOKMARKOPTIONS options
, [in] ULONGLONG position
, [in] LPARAM event
);
1047 HRESULT SetAdaptationData
([in, string] const WCHAR
*data
, [in] const ULONG count
);
1049 HRESULT Pause
(DWORD reserved
);
1050 HRESULT Resume
(DWORD reserved
);
1052 HRESULT SetVoice
([in] ISpVoice
*voice
, [in] BOOL changes
);
1053 HRESULT GetVoice
([out] ISpVoice
**voice
);
1054 HRESULT SetVoicePurgeEvent
([in] ULONGLONG interest
);
1055 HRESULT GetVoicePurgeEvent
([out] ULONGLONG
*interest
);
1057 HRESULT SetContextState
([in] SPCONTEXTSTATE state
);
1058 HRESULT GetContextState
([in] SPCONTEXTSTATE
*state
);
1063 uuid(6c44df74
-72b9
-4992-a1ec
-ef996e0422d4
),
1064 pointer_default(unique),
1067 interface ISpVoice
: ISpEventSource
1069 HRESULT SetOutput
([in] IUnknown
*unk
, [in] BOOL changes
);
1070 HRESULT GetOutputObjectToken
([out] ISpObjectToken
**token
);
1071 HRESULT GetOutputStream
([out] ISpStreamFormat
**stream
);
1073 HRESULT Pause
(void);
1074 HRESULT Resume
(void);
1076 HRESULT SetVoice
([in] ISpObjectToken
*token
);
1077 HRESULT GetVoice
([out] ISpObjectToken
**token
);
1079 HRESULT Speak
([in, string] const WCHAR
*pwcs
,
1081 [out] ULONG
*number
);
1082 HRESULT SpeakStream
([in] IStream
*stream
,
1084 [out] ULONG
*number
);
1087 [out] SPVOICESTATUS
*status
,
1088 [out, string] WCHAR
**bookmark
);
1090 HRESULT Skip
([in,string] const WCHAR
*type
, [in] long items
, [out] ULONG
*skipped
);
1092 HRESULT SetPriority
([in] SPVPRIORITY priority
);
1093 HRESULT GetPriority
([out] SPVPRIORITY
* priority
);
1095 HRESULT SetAlertBoundary
([in] SPEVENTENUM boundary
);
1096 HRESULT GetAlertBoundary
([out] SPEVENTENUM
* boundary
);
1098 HRESULT SetRate
([in] long adjust
);
1099 HRESULT GetRate
([out] long *adjust
);
1101 HRESULT SetVolume
([in] USHORT volume
);
1102 HRESULT GetVolume
([out] USHORT
*volume
);
1104 HRESULT WaitUntilDone
([in] ULONG timeout
);
1106 HRESULT SetSyncSpeakTimeout
([in] ULONG timeout
);
1107 HRESULT GetSyncSpeakTimeout
([out] ULONG
*timeout
);
1109 [local] HANDLE SpeakCompleteEvent
();
1111 [local] HRESULT IsUISupported
(
1112 [in] const WCHAR
*type
,
1115 [out] BOOL
*supported
);
1116 [local] HRESULT DisplayUI
(
1118 [in] const WCHAR
*title
,
1119 [in] const WCHAR
*type
,
1126 uuid(be7a9cc9
-5f9e
-11d2
-960f
-00c04f8ee628
),
1127 pointer_default(unique),
1131 interface ISpEventSink
: IUnknown
1133 HRESULT AddEvents
([in] const SPEVENT
*events
, [in] ULONG count
);
1134 HRESULT GetEventInterest
([out] ULONGLONG
*interest
);
1139 uuid(5b559f40
-e952
-11d2
-bb91
-00c04f8ee6c0
),
1140 pointer_default(unique),
1143 interface ISpObjectWithToken
: IUnknown
1145 HRESULT SetObjectToken
([in] ISpObjectToken
*token
);
1146 HRESULT GetObjectToken
([out] ISpObjectToken
**token
);
1151 uuid(bed530be
-2606-4f4d
-a1c0
-54c5cda5566f
),
1152 pointer_default(unique),
1155 interface ISpStreamFormat
: IStream
1157 HRESULT GetFormat
(GUID
*format
, WAVEFORMATEX
**wave
);
1162 uuid(c05c768f
-fae8
-4ec2
-8e07
-338321c12452
),
1163 pointer_default(unique),
1167 interface ISpAudio
: ISpStreamFormat
1169 HRESULT SetState
([in] SPAUDIOSTATE state
, [in] ULONGLONG reserved
);
1170 HRESULT SetFormat
([in] REFGUID guid
, [in] const WAVEFORMATEX
*wave
);
1171 HRESULT GetStatus
([out] SPAUDIOSTATUS
*status
);
1172 HRESULT SetBufferInfo
([in] const SPAUDIOBUFFERINFO
*buffer
);
1173 HRESULT GetBufferInfo
([out] SPAUDIOBUFFERINFO
*buffer
);
1174 HRESULT GetDefaultFormat
([out] GUID
*guid
, [out] WAVEFORMATEX
**wave
);
1175 HANDLE EventHandle
();
1176 HRESULT GetVolumeLevel
([out] ULONG
*level
);
1177 HRESULT SetVolumeLevel
([in] ULONG level
);
1178 HRESULT GetBufferNotifySize
([out] ULONG
*size
);
1179 HRESULT SetBufferNotifySize
([in] ULONG size
);
1183 uuid(15806f6e
-1d70
-4b48
-98e6
-3b1a007509ab
),
1184 pointer_default(unique),
1188 interface ISpMMSysAudio
: ISpAudio
1190 HRESULT GetDeviceId
([out] UINT
*id);
1191 HRESULT SetDeviceId
([in] UINT
id);
1192 HRESULT GetMMHandle
([out] void **handle);
1193 HRESULT GetLineId
([out] UINT
*id);
1194 HRESULT SetLineId
([in] UINT
id);
1199 uuid(5b4fb971
-b115
-4de1
-ad97
-e482e3bf6ee4
),
1200 pointer_default(unique),
1204 interface ISpProperties
: IUnknown
1206 HRESULT SetPropertyNum
([in] const WCHAR
*name
, [in] long value
);
1207 HRESULT GetPropertyNum
([in] const WCHAR
*name
, [out] long *value
);
1208 HRESULT SetPropertyString
([in] const WCHAR
*name
, [in] const WCHAR
*value
);
1209 HRESULT GetPropertyString
([in] const WCHAR
*name
, [out] WCHAR
**value
);
1214 uuid(c2b5f241
-daa0
-4507-9e16
-5a1eaa2b7a5c
),
1215 pointer_default(unique),
1218 interface ISpRecognizer
: ISpProperties
1220 HRESULT SetRecognizer
([in] ISpObjectToken
*recognizer
);
1221 HRESULT GetRecognizer
([out] ISpObjectToken
**recognizer
);
1223 HRESULT SetInput
([in] IUnknown
*input
, [in] BOOL changes
);
1224 HRESULT GetInputObjectToken
([out] ISpObjectToken
**token
);
1226 HRESULT GetInputStream
( [out] ISpStreamFormat
**stream
);
1227 HRESULT CreateRecoContext
([out] ISpRecoContext
**cxt
);
1229 HRESULT GetRecoProfile
([out] ISpObjectToken
**token
);
1230 HRESULT SetRecoProfile
([in] ISpObjectToken
*token
);
1232 HRESULT IsSharedInstance
(void);
1234 HRESULT GetRecoState
([out] SPRECOSTATE
*state
);
1235 HRESULT SetRecoState
([in] SPRECOSTATE state
);
1237 HRESULT GetStatus
([out] SPRECOGNIZERSTATUS
*status
);
1238 HRESULT GetFormat
([in] SPSTREAMFORMATTYPE type
, [out] GUID
*format
, [out] WAVEFORMATEX
**wave
);
1240 [local] HRESULT IsUISupported
([in] const WCHAR
*type
, [in] void *extra
, [in] ULONG count
,
1241 [out] BOOL
*supported
);
1242 [local] HRESULT DisplayUI
([in] HWND hwnd
,[in] const WCHAR
*title
, [in] const WCHAR
*type
,
1243 [in] void *extra
, [in] ULONG cnt
);
1244 HRESULT EmulateRecognition
([in] ISpPhrase
*phrase
);
1249 uuid(12e3cca9
-7518-44c5
-a5e7
-ba5a79cb929e
),
1250 pointer_default(unique),
1254 interface ISpStream
: ISpStreamFormat
1256 HRESULT SetBaseStream
([in] IStream
*stream
, [in] REFGUID format
, [in] const WAVEFORMATEX
*wave
);
1257 HRESULT GetBaseStream
([out] IStream
**stream
);
1258 HRESULT BindToFile
([in] LPCWSTR filename
, [in] SPFILEMODE mode
, [in] const GUID
*format
,
1259 const WAVEFORMATEX
*wave
, [in] ULONGLONG interest
);
1264 helpstring("Speech Object Library"),
1265 uuid(c866ca3a
-32f7
-11d2
-9602-00c04f8ee628
),
1270 importlib
("stdole2.tlb");
1272 #include
"sapiaut.idl"
1275 uuid(a910187f
-0c7a
-45ac
-92cc
-59edafb77b53
),
1276 helpstring("SpObjectTokenCategory Class"),
1277 progid
("SAPI.SpObjectTokenCategory.1"),
1278 vi_progid
("SAPI.SpObjectTokenCategory"),
1281 coclass SpObjectTokenCategory
1283 interface ISpObjectTokenCategory
;
1287 uuid(ef411752
-3736-4cb4
-9c8c
-8ef4ccb58efe
),
1288 helpstring("Object Token"),
1289 progid
("SAPI.SpObjectToken.1"),
1290 vi_progid
("SAPI.SpObjectToken"),
1293 coclass SpObjectToken
1295 interface ISpObjectToken
;
1296 [default] interface ISpDataKey
;
1300 uuid(96749373-3391-11d2
-9ee3
-00c04f797396
),
1301 helpstring("Resource Manager"),
1302 progid
("SAPI.SpResourceManager.1"),
1303 vi_progid
("SAPI.SpResourceManager"),
1308 coclass SpResourceManager
1310 [default] interface ISpResourceManager
;
1314 uuid(3bee4890
-4fe9
-4a37
-8c1e
-5e7e12791c1f
)
1316 coclass SpSharedRecognizer
1318 /*[default] interface ISpeechRecognizer;*/
1319 interface ISpRecognizer
;
1323 uuid(715d9c59
-4442-11d2
-9605-00c04f8ee628
),
1324 helpstring("Speech Stream"),
1325 progid
("SAPI.SpStream.1"),
1326 vi_progid
("SAPI.SpStream"),
1333 interface ISpStream
;
1337 uuid(96749377-3391-11d2
-9ee3
-00c04f797396
)
1342 [default] interface ISpeechVoice
;
1346 uuid(947812b3
-2ae1
-4644-ba86
-9e90ded7ec91
),
1348 coclass SpFileStream
1350 interface ISpStream
;
1351 [default] interface ISpeechFileStream
;
1355 uuid(ab1890a0
-e91f
-11d2
-bb91
-00c04f8ee6c0
),
1359 coclass SpMMAudioEnum
1361 interface IEnumSpObjectTokens
;
1365 uuid(cf3d2e50
-53f2
-11d2
-960c
-00c04f8ee628
)
1369 interface ISpEventSource
;
1370 interface ISpEventSink
;
1371 interface ISpObjectWithToken
;
1372 interface ISpMMSysAudio
;
1376 uuid(a8c680eb
-3d32
-11d2
-9ee7
-00c04f797396
)
1378 coclass SpMMAudioOut
1380 interface ISpEventSource
;
1381 interface ISpEventSink
;
1382 interface ISpObjectWithToken
;
1383 interface ISpMMSysAudio
;