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 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
;
371 float SREngineConfidence
;
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
;
391 typedef [restricted, hidden] struct SPAUDIOSTATUS
393 long cbFreeBuffSpace
;
394 ULONG cbNonBlockingIO
;
396 ULONGLONG CurSeekPos
;
397 ULONGLONG CurDevicePos
;
402 typedef [restricted, hidden] struct SPRECOGNIZERSTATUS
404 SPAUDIOSTATUS AudioStatus
;
405 ULONGLONG ullRecognitionStreamPos
;
406 ULONG ulStreamNumber
;
410 LANGID aLangID
[SP_MAX_LANGIDS
];
411 ULONGLONG ullRecognitionStreamTime
;
412 } SPRECOGNIZERSTATUS
;
414 typedef [restricted, hidden] struct SPPHRASERULE SPPHRASERULE
;
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
;
434 const WCHAR
*pszValue
;
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
457 ULONGLONG ullGrammarID
;
458 ULONGLONG ftStartTime
;
459 ULONGLONG ullAudioStreamPosition
;
460 ULONG ulAudioSizeBytes
;
461 ULONG ulRetainedSizeBytes
;
462 ULONG ulAudioSizeTime
;
464 const SPPHRASEPROPERTY
*pProperties
;
465 const SPPHRASEELEMENT
*pElements
;
467 const SPPHRASEREPLACEMENT
*pReplacements
;
469 ULONG ulSREnginePrivateDataSize
;
470 const BYTE *pSREnginePrivateData
;
473 typedef [restricted, hidden] struct SPSERIALIZEDPHRASE
475 ULONG ulSerializedSize
;
476 } SPSERIALIZEDPHRASE
;
478 typedef [restricted, hidden] struct SPRECORESULTTIMES
480 FILETIME ftStreamTime
;
486 typedef [hidden] enum 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\"")
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};")
515 interface IEnumSpObjectTokens
;
516 interface ISpEventSource
;
517 interface ISpRecoContext
;
518 interface ISpRecognizer
;
519 interface ISpStreamFormat
;
523 uuid(14056581-e16c
-11d2
-bb90
-00c04f8ee6c0
),
524 helpstring("ISpDataKey"),
525 pointer_default(unique),
529 interface ISpDataKey
: IUnknown
531 HRESULT SetData
([in] LPCWSTR pszValueName
,
533 [in] const BYTE *pData
);
534 HRESULT GetData
([in] LPCWSTR pszValueName
,
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
,
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
);
558 uuid(92a66e2b
-c830
-4149-83df
-6fc2ba1e7a5b
),
559 helpstring("ISpRegDataKey"),
560 pointer_default(unique),
563 interface ISpRegDataKey
: ISpDataKey
565 [local] HRESULT SetKey
([in] HKEY hkey
, [in] BOOL fReadOnly
);
570 uuid(2d3d3845
-39af
-4850-bbf9
-40b49780011d
),
571 helpstring("ISpObjectTokenCategory"),
572 pointer_default(unique),
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
);
592 uuid(14056589-e16c
-11d2
-bb90
-00c04f8ee6c0
),
593 helpstring("ISpObjectToken"),
594 pointer_default(unique),
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
,
608 [out, iid_is(riid
)] void **ppvObject
);
609 HRESULT GetStorageFileName
([in] REFCLSID clsidCaller
,
610 [in] LPCWSTR pszValueName
,
611 [in, string] LPCWSTR pszFileNameSpecifier
,
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
);
635 uuid(06b64f9e
-7fda
-11d2
-b4f2
-00c04f797396
),
636 helpstring("IEnumSpObjectTokens"),
637 pointer_default(unique),
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
);
648 HRESULT Clone
([out] IEnumSpObjectTokens
**ppEnum
);
649 HRESULT Item
([in] ULONG Index
,
650 [out] ISpObjectToken
**ppToken
);
651 HRESULT GetCount
([out] ULONG
*pCount
);
656 uuid(93384e18
-5014-43d5
-adbb
-a78e055926bd
),
657 helpstring("ISpResourceManager"),
658 pointer_default(unique),
661 interface ISpResourceManager
: IServiceProvider
663 HRESULT SetObject
([in] REFGUID guidServiceId
,
664 [in] IUnknown
*pUnkObject
);
665 HRESULT GetObject
([in] REFGUID guidServiceId
,
666 [in] REFCLSID ObjectCLSID
,
667 [in] REFIID ObjectIID
,
668 [in] BOOL fReleaseWhenLastExternalRefReleased
,
669 [out, iid_is(ObjectIID
)] void** ppObject
);
674 uuid(1a5c0354
-b621
-4b5a
-8791-d306ed379e53
),
676 pointer_default(unique),
679 interface ISpPhrase
: IUnknown
681 HRESULT GetPhrase
([out] SPPHRASE
**phrase
);
682 HRESULT GetSerializedPhrase
([out] SPSERIALIZEDPHRASE
**phrase
);
683 HRESULT GetText
([in] ULONG start
, [in] ULONG count
, [in] BOOL replacements
,
684 [out] WCHAR
**text
, [out] BYTE *attributes
);
685 HRESULT Discard
([in] DWORD types
);
690 uuid(8fcebc98
-4e49
-4067-9c6c
-d86a0e092e3d
),
692 pointer_default(unique),
695 interface ISpPhraseAlt
: ISpPhrase
697 HRESULT GetAltInfo
(ISpPhrase
**parent
, ULONG
*start
, ULONG
*count
,
704 uuid(20b053be
-e235
-43cd
-9a2a
-8d17a48b7842
),
705 pointer_default(unique),
709 interface ISpRecoResult
: ISpPhrase
711 HRESULT GetResultTimes
([out] SPRECORESULTTIMES
*times
);
713 HRESULT GetAlternates
(
717 [out] ISpPhraseAlt
**phrases
,
718 [out] ULONG
*returned
);
723 [out] ISpStreamFormat
**stream
);
728 [out] ULONG
*number
);
730 HRESULT Serialize
([out] SPSERIALIZEDRESULT
**result
);
732 HRESULT ScaleAudio
([in] const GUID
*format
, [in] const WAVEFORMATEX
*wave
);
734 HRESULT GetRecoContext
([out] ISpRecoContext
*context
);
739 uuid(8137828f
-591a
-4a42
-be58
-49ea7ebaac68
),
740 helpstring("ISpGrammarBuilder Interface"),
741 pointer_default(unique),
745 interface ISpGrammarBuilder
: IUnknown
747 HRESULT ResetGrammar
([in] LANGID language
);
749 HRESULT GetRule
([in] const WCHAR
*rule
,
751 [in] DWORD attributes
,
752 [in] BOOL should_create
,
753 [out] SPSTATEHANDLE
*state
);
754 HRESULT ClearRule
(SPSTATEHANDLE state
);
756 HRESULT CreateNewState
(
757 [in] SPSTATEHANDLE instate
,
758 [out] SPSTATEHANDLE
*outstate
);
760 HRESULT AddWordTransition
(
761 [in] SPSTATEHANDLE from_state
,
762 [in] SPSTATEHANDLE to_state
,
763 [in] const WCHAR
*value
,
764 [in] const WCHAR
*separators
,
765 [in] SPGRAMMARWORDTYPE type
,
767 [in] const SPPROPERTYINFO
*info
);
769 HRESULT AddRuleTransition
(
770 [in] SPSTATEHANDLE from_state
,
771 [in] SPSTATEHANDLE to_state
,
772 [in] SPSTATEHANDLE rule
,
774 [in] const SPPROPERTYINFO
*info
);
776 HRESULT AddResource
([in] SPSTATEHANDLE state
,
777 [in] const WCHAR
*name
,
778 [in] const WCHAR
*value
);
780 HRESULT Commit
([in] DWORD reserved
);
785 uuid(2177db29
-7f45
-47d0
-8554-067e91c80502
),
786 pointer_default(unique),
790 interface ISpRecoGrammar
: ISpGrammarBuilder
792 HRESULT GetGrammarId
([out] ULONGLONG
*grammar
);
793 HRESULT GetRecoContext
([out] ISpRecoContext
**context
);
795 HRESULT LoadCmdFromFile
([in, string] const WCHAR
* pszFileName
, [in] SPLOADOPTIONS options
);
796 HRESULT LoadCmdFromObject
([in] REFCLSID rcid
, [in, string] const WCHAR
* pszGrammarName
, [in] SPLOADOPTIONS options
);
797 HRESULT LoadCmdFromResource
([in] HMODULE hmod
,
798 [in, string] const WCHAR
*name
,
799 [in, string] const WCHAR
*type
,
801 [in] SPLOADOPTIONS options
);
802 HRESULT LoadCmdFromMemory
([in] const SPBINARYGRAMMAR
*grammar
, [in] SPLOADOPTIONS options
);
803 HRESULT LoadCmdFromProprietaryGrammar
(
805 [in, string] const WCHAR
*param
,
806 [in] const void *data
,
808 [in] SPLOADOPTIONS options
);
809 HRESULT SetRuleState
([in, string] const WCHAR
*name
, [in] void *reserved
,
810 [in] SPRULESTATE state
);
811 HRESULT SetRuleIdState
([in] ULONG rule
, [in] SPRULESTATE state
);
813 HRESULT LoadDictation
([in, string] const WCHAR
*name
, [in] SPLOADOPTIONS options
);
814 HRESULT UnloadDictation
();
815 HRESULT SetDictationState
([in] SPRULESTATE state
);
817 HRESULT SetWordSequenceData
([in] const WCHAR
*text
, [in] ULONG count
, [in] const SPTEXTSELECTIONINFO
*info
);
818 HRESULT SetTextSelection
([in] const SPTEXTSELECTIONINFO
*info
);
820 HRESULT IsPronounceable
([in, string] const WCHAR
*word
, [out] SPWORDPRONOUNCEABLE
*pronounceable
);
822 HRESULT SetGrammarState
([in] SPGRAMMARSTATE state
);
824 HRESULT SaveCmd
([in] IStream
*stream
, [out, optional] WCHAR
**error
);
826 HRESULT GetGrammarState
([out] SPGRAMMARSTATE
*state
);
831 uuid(259684dc
-37c3
-11d2
-9603-00c04f8ee628
),
832 pointer_default(unique),
835 interface ISpNotifySink
: IUnknown
837 HRESULT Notify
(void);
842 uuid(6c44df74
-72b9
-4992-a1ec
-ef996e0422d4
),
843 pointer_default(unique),
846 interface ISpVoice
: ISpEventSource
848 HRESULT SetOutput
([in] IUnknown
*unk
, [in] BOOL changes
);
849 HRESULT GetOutputObjectToken
([out] ISpObjectToken
**token
);
850 HRESULT GetOutputStream
([out] ISpStreamFormat
**stream
);
853 HRESULT Resume
(void);
855 HRESULT SetVoice
([in] ISpObjectToken
*token
);
856 HRESULT GetVoice
([out] ISpObjectToken
**token
);
858 HRESULT Speak
([in, string] const WCHAR
*pwcs
,
860 [out] ULONG
*number
);
861 HRESULT SpeakStream
([in] IStream
*stream
,
863 [out] ULONG
*number
);
866 [out] SPVOICESTATUS
*status
,
867 [out, string] WCHAR
**bookmark
);
869 HRESULT Skip
([in,string] const WCHAR
*type
, [in] long items
, [out] ULONG
*skipped
);
871 HRESULT SetPriority
([in] SPVPRIORITY priority
);
872 HRESULT GetPriority
([out] SPVPRIORITY
* priority
);
874 HRESULT SetAlertBoundary
([in] SPEVENTENUM boundary
);
875 HRESULT GetAlertBoundary
([out] SPEVENTENUM
* boundary
);
877 HRESULT SetRate
([in] long adjust
);
878 HRESULT GetRate
([out] long *adjust
);
880 HRESULT SetVolume
([in] USHORT volume
);
881 HRESULT GetVolume
([out] USHORT
*volume
);
883 HRESULT WaitUntilDone
([in] ULONG timeout
);
885 HRESULT SetSyncSpeakTimeout
([in] ULONG timeout
);
886 HRESULT GetSyncSpeakTimeout
([out] ULONG
*timeout
);
888 [local] HANDLE SpeakCompleteEvent
();
890 [local] HRESULT IsUISupported
(
891 [in] const WCHAR
*type
,
894 [out] BOOL
*supported
);
895 [local] HRESULT DisplayUI
(
897 [in] const WCHAR
*title
,
898 [in] const WCHAR
*type
,
905 uuid(5eff4aef
-8487-11d2
-961c
-00c04f8ee628
),
906 pointer_default(unique),
909 interface ISpNotifySource
: IUnknown
911 HRESULT SetNotifySink
([in] ISpNotifySink
*sink
);
912 [local] HRESULT SetNotifyWindowMessage
(
917 [local] HRESULT SetNotifyCallbackFunction
(
918 [in] SPNOTIFYCALLBACK
*callback,
921 [local] HRESULT SetNotifyCallbackInterface
(
922 [in] ISpNotifyCallback
*callback,
925 [local] HRESULT SetNotifyWin32Event
(void);
926 [local] HRESULT WaitForNotifyEvent
([in] DWORD milliseconds
);
927 [local] HANDLE GetNotifyEventHandle
();
932 uuid(be7a9cce
-5f9e
-11d2
-960f
-00c04f8ee628
),
933 pointer_default(unique),
937 interface ISpEventSource
: ISpNotifySource
939 HRESULT SetInterest
([in] ULONGLONG event
, [in] ULONGLONG queued
);
940 HRESULT GetEvents
([in] ULONG count
,
941 [out, size_is(count
)] SPEVENT
*array
,
942 [out] ULONG
*fetched
);
943 HRESULT GetInfo
([out] SPEVENTSOURCEINFO
*info
);
948 uuid(f740a62f
-7c15
-489e-8234-940a33d9272d
),
949 pointer_default(unique),
953 interface ISpRecoContext
: ISpEventSource
955 HRESULT GetRecognizer
([out] ISpRecognizer
**recognizer
);
957 HRESULT CreateGrammar
([in] ULONGLONG grammar
, [out] ISpRecoGrammar
**spgrammar
);
959 HRESULT GetStatus
([out] SPRECOCONTEXTSTATUS
*status
);
961 HRESULT GetMaxAlternates
([in] ULONG
*alternates
);
962 HRESULT SetMaxAlternates
([in] ULONG alternates
);
964 HRESULT SetAudioOptions
([in] SPAUDIOOPTIONS options
, [in] const GUID
*format
, [in] const WAVEFORMATEX
*wave
);
965 HRESULT GetAudioOptions
([in] SPAUDIOOPTIONS
*options
, [out] GUID
*format
, [out] WAVEFORMATEX
**wave
);
967 HRESULT DeserializeResult
([in] const SPSERIALIZEDRESULT
*serialized
, [out] ISpRecoResult
**result
);
969 HRESULT Bookmark
([in] SPBOOKMARKOPTIONS options
, [in] ULONGLONG position
, [in] LPARAM event
);
971 HRESULT SetAdaptationData
([in, string] const WCHAR
*data
, [in] const ULONG count
);
973 HRESULT Pause
(DWORD reserved
);
974 HRESULT Resume
(DWORD reserved
);
976 HRESULT SetVoice
([in] ISpVoice
*voice
, [in] BOOL changes
);
977 HRESULT GetVoice
([out] ISpVoice
**voice
);
978 HRESULT SetVoicePurgeEvent
([in] ULONGLONG interest
);
979 HRESULT GetVoicePurgeEvent
([out] ULONGLONG
*interest
);
981 HRESULT SetContextState
([in] SPCONTEXTSTATE state
);
982 HRESULT GetContextState
([in] SPCONTEXTSTATE
*state
);
987 uuid(bed530be
-2606-4f4d
-a1c0
-54c5cda5566f
),
988 pointer_default(unique),
991 interface ISpStreamFormat
: IStream
993 HRESULT GetFormat
(GUID
*format
, WAVEFORMATEX
**wave
);
998 uuid(5b4fb971
-b115
-4de1
-ad97
-e482e3bf6ee4
),
999 pointer_default(unique),
1003 interface ISpProperties
: IUnknown
1005 HRESULT SetPropertyNum
([in] const WCHAR
*name
, [in] long value
);
1006 HRESULT GetPropertyNum
([in] const WCHAR
*name
, [out] long *value
);
1007 HRESULT SetPropertyString
([in] const WCHAR
*name
, [in] const WCHAR
*value
);
1008 HRESULT GetPropertyString
([in] const WCHAR
*name
, [out] WCHAR
**value
);
1013 uuid(c2b5f241
-daa0
-4507-9e16
-5a1eaa2b7a5c
),
1014 pointer_default(unique),
1017 interface ISpRecognizer
: ISpProperties
1019 HRESULT SetRecognizer
([in] ISpObjectToken
*recognizer
);
1020 HRESULT GetRecognizer
([out] ISpObjectToken
**recognizer
);
1022 HRESULT SetInput
([in] IUnknown
*input
, [in] BOOL changes
);
1023 HRESULT GetInputObjectToken
([out] ISpObjectToken
**token
);
1025 HRESULT GetInputStream
( [out] ISpStreamFormat
**stream
);
1026 HRESULT CreateRecoContext
([out] ISpRecoContext
**cxt
);
1028 HRESULT GetRecoProfile
([out] ISpObjectToken
**token
);
1029 HRESULT SetRecoProfile
([in] ISpObjectToken
*token
);
1031 HRESULT IsSharedInstance
(void);
1033 HRESULT GetRecoState
([out] SPRECOSTATE
*state
);
1034 HRESULT SetRecoState
([in] SPRECOSTATE state
);
1036 HRESULT GetStatus
([out] SPRECOGNIZERSTATUS
*status
);
1037 HRESULT GetFormat
([in] SPSTREAMFORMATTYPE type
, [out] GUID
*format
, [out] WAVEFORMATEX
**wave
);
1039 [local] HRESULT IsUISupported
([in] const WCHAR
*type
, [in] void *extra
, [in] ULONG count
,
1040 [out] BOOL
*supported
);
1041 [local] HRESULT DisplayUI
([in] HWND hwnd
,[in] const WCHAR
*title
, [in] const WCHAR
*type
,
1042 [in] void *extra
, [in] ULONG cnt
);
1043 HRESULT EmulateRecognition
([in] ISpPhrase
*phrase
);
1048 uuid(12e3cca9
-7518-44c5
-a5e7
-ba5a79cb929e
),
1049 pointer_default(unique),
1053 interface ISpStream
: ISpStreamFormat
1055 HRESULT SetBaseStream
([in] IStream
*stream
, [in] REFGUID format
, [in] const WAVEFORMATEX
*wave
);
1056 HRESULT GetBaseStream
([out] IStream
**stream
);
1057 HRESULT BindToFile
([in] LPCWSTR filename
, [in] SPFILEMODE mode
, [in] const GUID
*format
,
1058 const WAVEFORMATEX
*wave
, [in] ULONGLONG interest
);
1063 helpstring("Speech Object Library"),
1064 uuid(c866ca3a
-32f7
-11d2
-9602-00c04f8ee628
),
1069 importlib
("stdole2.tlb");
1071 #include
"sapiaut.idl"
1074 uuid(a910187f
-0c7a
-45ac
-92cc
-59edafb77b53
),
1075 helpstring("SpObjectTokenCategory Class"),
1076 progid
("SAPI.SpObjectTokenCategory.1"),
1077 vi_progid
("SAPI.SpObjectTokenCategory"),
1080 coclass SpObjectTokenCategory
1082 interface ISpObjectTokenCategory
;
1086 uuid(ef411752
-3736-4cb4
-9c8c
-8ef4ccb58efe
),
1087 helpstring("Object Token"),
1088 progid
("SAPI.SpObjectToken.1"),
1089 vi_progid
("SAPI.SpObjectToken"),
1092 coclass SpObjectToken
1094 interface ISpObjectToken
;
1095 [default] interface ISpDataKey
;
1099 uuid(96749373-3391-11d2
-9ee3
-00c04f797396
),
1100 helpstring("Resource Manager"),
1101 progid
("SAPI.SpResourceManager.1"),
1102 vi_progid
("SAPI.SpResourceManager"),
1107 coclass SpResourceManager
1109 [default] interface ISpResourceManager
;
1113 uuid(3bee4890
-4fe9
-4a37
-8c1e
-5e7e12791c1f
)
1115 coclass SpSharedRecognizer
1117 /*[default] interface ISpeechRecognizer;*/
1118 interface ISpRecognizer
;
1122 uuid(715d9c59
-4442-11d2
-9605-00c04f8ee628
),
1123 helpstring("Speech Stream"),
1124 progid
("SAPI.SpStream.1"),
1125 vi_progid
("SAPI.SpStream"),
1132 interface ISpStream
;
1136 uuid(96749377-3391-11d2
-9ee3
-00c04f797396
)
1141 [default] interface ISpeechVoice
;
1145 uuid(947812b3
-2ae1
-4644-ba86
-9e90ded7ec91
),
1147 coclass SpFileStream
1149 interface ISpStream
;
1150 [default] interface ISpeechFileStream
;