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(1a5c0354
-b621
-4b5a
-8791-d306ed379e53
),
658 pointer_default(unique),
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
);
672 uuid(8fcebc98
-4e49
-4067-9c6c
-d86a0e092e3d
),
674 pointer_default(unique),
677 interface ISpPhraseAlt
: ISpPhrase
679 HRESULT GetAltInfo
(ISpPhrase
**parent
, ULONG
*start
, ULONG
*count
,
686 uuid(20b053be
-e235
-43cd
-9a2a
-8d17a48b7842
),
687 pointer_default(unique),
691 interface ISpRecoResult
: ISpPhrase
693 HRESULT GetResultTimes
([out] SPRECORESULTTIMES
*times
);
695 HRESULT GetAlternates
(
699 [out] ISpPhraseAlt
**phrases
,
700 [out] ULONG
*returned
);
705 [out] ISpStreamFormat
**stream
);
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
);
721 uuid(8137828f
-591a
-4a42
-be58
-49ea7ebaac68
),
722 helpstring("ISpGrammarBuilder Interface"),
723 pointer_default(unique),
727 interface ISpGrammarBuilder
: IUnknown
729 HRESULT ResetGrammar
([in] LANGID language
);
731 HRESULT GetRule
([in] const WCHAR
*rule
,
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
,
749 [in] const SPPROPERTYINFO
*info
);
751 HRESULT AddRuleTransition
(
752 [in] SPSTATEHANDLE from_state
,
753 [in] SPSTATEHANDLE to_state
,
754 [in] SPSTATEHANDLE rule
,
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
);
767 uuid(2177db29
-7f45
-47d0
-8554-067e91c80502
),
768 pointer_default(unique),
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
,
783 [in] SPLOADOPTIONS options
);
784 HRESULT LoadCmdFromMemory
([in] const SPBINARYGRAMMAR
*grammar
, [in] SPLOADOPTIONS options
);
785 HRESULT LoadCmdFromProprietaryGrammar
(
787 [in, string] const WCHAR
*param
,
788 [in] const void *data
,
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
);
813 uuid(259684dc
-37c3
-11d2
-9603-00c04f8ee628
),
814 pointer_default(unique),
817 interface ISpNotifySink
: IUnknown
819 HRESULT Notify
(void);
824 uuid(6c44df74
-72b9
-4992-a1ec
-ef996e0422d4
),
825 pointer_default(unique),
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
);
835 HRESULT Resume
(void);
837 HRESULT SetVoice
([in] ISpObjectToken
*token
);
838 HRESULT GetVoice
([out] ISpObjectToken
**token
);
840 HRESULT Speak
([in, string] const WCHAR
*pwcs
,
842 [out] ULONG
*number
);
843 HRESULT SpeakStream
([in] IStream
*stream
,
845 [out] ULONG
*number
);
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
,
876 [out] BOOL
*supported
);
877 [local] HRESULT DisplayUI
(
879 [in] const WCHAR
*title
,
880 [in] const WCHAR
*type
,
887 uuid(5eff4aef
-8487-11d2
-961c
-00c04f8ee628
),
888 pointer_default(unique),
891 interface ISpNotifySource
: IUnknown
893 HRESULT SetNotifySink
([in] ISpNotifySink
*sink
);
894 [local] HRESULT SetNotifyWindowMessage
(
899 [local] HRESULT SetNotifyCallbackFunction
(
900 [in] SPNOTIFYCALLBACK
*callback,
903 [local] HRESULT SetNotifyCallbackInterface
(
904 [in] ISpNotifyCallback
*callback,
907 [local] HRESULT SetNotifyWin32Event
(void);
908 [local] HRESULT WaitForNotifyEvent
([in] DWORD milliseconds
);
909 [local] HANDLE GetNotifyEventHandle
();
914 uuid(be7a9cce
-5f9e
-11d2
-960f
-00c04f8ee628
),
915 pointer_default(unique),
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
);
930 uuid(f740a62f
-7c15
-489e-8234-940a33d9272d
),
931 pointer_default(unique),
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
);
969 uuid(bed530be
-2606-4f4d
-a1c0
-54c5cda5566f
),
970 pointer_default(unique),
973 interface ISpStreamFormat
: IStream
975 HRESULT GetFormat
(GUID
*format
, WAVEFORMATEX
**wave
);
980 uuid(5b4fb971
-b115
-4de1
-ad97
-e482e3bf6ee4
),
981 pointer_default(unique),
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
);
995 uuid(c2b5f241
-daa0
-4507-9e16
-5a1eaa2b7a5c
),
996 pointer_default(unique),
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
);
1030 uuid(12e3cca9
-7518-44c5
-a5e7
-ba5a79cb929e
),
1031 pointer_default(unique),
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
);
1045 helpstring("Speech Object Library"),
1046 uuid(c866ca3a
-32f7
-11d2
-9602-00c04f8ee628
),
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"),
1062 coclass SpObjectTokenCategory
1064 interface ISpObjectTokenCategory
;
1068 uuid(ef411752
-3736-4cb4
-9c8c
-8ef4ccb58efe
),
1069 helpstring("Object Token"),
1070 progid
("SAPI.SpObjectToken.1"),
1071 vi_progid
("SAPI.SpObjectToken"),
1074 coclass SpObjectToken
1076 interface ISpObjectToken
;
1077 [default] interface ISpDataKey
;
1081 uuid(3bee4890
-4fe9
-4a37
-8c1e
-5e7e12791c1f
)
1083 coclass SpSharedRecognizer
1085 /*[default] interface ISpeechRecognizer;*/
1086 interface ISpRecognizer
;
1090 uuid(96749377-3391-11d2
-9ee3
-00c04f797396
)
1095 [default] interface ISpeechVoice
;
1099 uuid(947812b3
-2ae1
-4644-ba86
-9e90ded7ec91
),
1101 coclass SpFileStream
1103 interface ISpStream
;
1104 [default] interface ISpeechFileStream
;