ISpSREngine

Microsoft Speech SDK

The Microsoft.com Speech website Microsoft Speech SDK SAPI 5.1

ISpSREngine

This is the main interface that engine developers must implement to have a working SAPI SR engine. Engine vendors need to implement this interface in an InProc COM object with the threading model “Both”. This object can also implement the ISpObjectWithToken interface. SR engines may also have additional objects implementing ISpTokenUI, ISpSRAlternates, and a custom engine-extension object.

The SR Engine Guide describes in detail how an SR engine interacts with SAPI and how the methods of this interface are implemented.

Applications do not directly call the methods on this interface, all calls are made by SAPI.

Implemented By
  • SR engine developers as the main interface between their SR engine and SAPI.
How Created
  • Only SAPI will directly create this object. When an application creates a RecoContext object, either shared or InProc, then SAPI will find the appropriate recognizer object token and create the object implementing this interface from the CLSID in the object token.

Methods in Vtable Order

ISpSREngine Methods Description
SetSite Sets the ISpSREngineSite interface for the engine to use.
GetInputAudioFormat Gets the audio format that the SR engine supports.
RecognizeStream Begins recognition processing on a stream.
SetRecoProfile Passes the current active user profile to the engine.
OnCreateGrammar Creates a new recognition grammar.
OnDeleteGrammar Informs the engine of the deletion of a grammar.
LoadProprietaryGrammar Instructs the engine to load a grammar in an engine-specific format.
UnloadProprietaryGrammar Unloads an engine-specific grammar.
SetProprietaryRuleState Sets the proprietary grammar rule state.
SetProprietaryRuleIdState Sets the proprietary grammar rule ID state.
LoadSLM Instructs the engine to load a dictation statistical language model (SLM).
UnloadSLM Instructs the engine to unload an SLM.
SetSLMState Sets the recognition state of the SLM to active or inactive.
SetWordSequenceData Sets the text buffer information.
SetTextSelection Informs the engine of the displayed and selected areas of the text buffer.
IsPronounceable Determines if a word can be recognized by the engine.
OnCreateRecoContext Informs the engine of the creation of a recognition context.
OnDeleteRecoContext Notifies the engine that a recognition context is being destroyed.
PrivateCall Engine-specific call to the engine.
SetAdaptationData Provides text data for language model adaptation to the engine.
SetPropertyNum Sets a numerical property attribute on the SR engine.
GetPropertyNum Retrieves a numerical property attribute from the SR engine.
SetPropertyString Sets a text property attribute on the SR engine.
GetPropertyString Retrieves a text property attribute from the SR engine.
SetGrammarState Informs the engine if a grammar has been activated or deactivated.
WordNotify Notifies the SR engine of the words in CFG grammars.
RuleNotify Notifies the SR engine of the rule information in CFG grammars.
PrivateCallEx Calls the engine which allows a variable sized data block can be returned from the engine to the engine extension object..
SetContextState Indicates that a recognition context has been deactivated or activated.