Export (0) Print
Expand All

ISpRecognizer (SAPI 5.3)

Speech API 5.3
Microsoft Speech API 5.3

ISpRecognizer

The ISpRecognizer interface enables applications to control aspects of the speech recognition (SR) engine. Each ISpRecognizer interface represents a single SR engine. The application can connect to each recognizer object one or more recognition contexts, from which the application can control the recognition grammars to be used, start and stop recognition, and receive events and recognition results. The ISpRecognizer interface allows some additional control of the SR engine and its audio input. A standard application may not need to call many of the methods on this interface as SAPI tries to set the engine up sensibly by default.

There are two implementations of the ISpRecognizer and ISpRecoContext in SAPI. One is for recognition "in-process" (InProc), where the SR engine is created in the same process as the application. Only this application can connect to this recognizer. The other implementation is the "shared-recognizer," where the SR engine is created in a separate process. There will only be one shared engine running on a system, and all applications using the shared engine connect to the same recognizer. This allows several speech applications to work simultaneously, and allows the user to speak to any application, as recognition is done from the grammars of all applications. For desktop-based speech applications it is recommended to use the shared recognizer because of the way it allows multiple SAPI applications to work at once. For other types of application, such as recognizing from wave files or a telephony server application where multiple SR engines will be required, the InProc recognizer should be used.

When to Use

Call methods of the ISpRecognizer interface to configure or retrieve the attributes of the SR engine.

Implemented By
  • This interface is implemented by SAPI. Application developers use this interface but do not implement it.
How Created
There are two objects that implement this interface. These are created by applications by creating a COM object with either of the following CLSIDs:

Alternatively, the shared recognizer can be created by creating a SpSharedRecoContext (CLSID_SpSharedRecoContext), and then calling ISpRecoContext::GetRecognizer on this object to get a reference to the SpSharedRecognizer object.

Methods in Vtable Order

ISpRecognizer MethodsDescription
ISpPropertiesInherits from ISpProperties and all those methods are accessible from ISpRecognizer.
SetRecognizerSpecifies the SR engine to be used.
GetRecognizerRetrieves which SR engine is currently being used.
SetInputSpecifies which input stream the SR engine should use.
GetInputObjectTokenRetrieves the input token object for the stream.
GetInputStreamRetrieves the input stream.
CreateRecoContextCreates a recognition context for this instance of an SR engine.
GetRecoProfileRetrieves the current recognition profile token.
SetRecoProfileSets the recognition profile to be used by the recognizer.
IsSharedInstanceDetermines if the recognizer is the shared or InProc implementation.
GetRecoStateRetrieves the state of the recognition engine.
SetRecoStateSets the state of the recognition engine.
GetStatusRetrieves current status information for the engine.
GetFormatRetrieves the format of the current audio input.
IsUISupportedChecks if the SR engine supports a particular user interface component.
DisplayUIDisplays a user interface component.
EmulateRecognitionEmulates a recognition from a text phrase rather than from spoken audio.
Show:
© 2014 Microsoft