Share via


Note

Please see Azure Cognitive Services for Speech documentation for the latest supported speech solutions.

Microsoft Speech Platform

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 the Speech Platform tries to set the engine up sensibly by default.

In the implementations of the ISpRecognizer and ISpRecoContext in the Speech Platform, the speech recognition engine is created in the same process as the application. Only this application can connect to this recognizer. This makes possible, for example, a telephony server application where multiple speech recognition engines will be required.

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 the Speech Platform. Application developers use this interface but do not implement it.

How Created

The following object implements this interface. Applications can create this object by creating a COM object with the following CLSID:

  • SpInprocRecognizer (CLSID_SpInprocRecognizer)

Methods in Vtable Order

ISpRecognizer Methods Description
ISpProperties Inherits from ISpProperties and all those methods are accessible from ISpRecognizer.
SetRecognizer Specifies the SR engine to be used.
GetRecognizer Retrieves which SR engine is currently being used.
SetInput Specifies which input stream the SR engine should use.
GetInputObjectToken Retrieves the input token object for the stream.
GetInputStream Retrieves the input stream.
CreateRecoContext Creates a recognition context for this instance of an SR engine.
GetRecoState Retrieves the state of the recognition engine.
SetRecoState Sets the state of the recognition engine.
GetStatus Retrieves current status information for the engine.
GetFormat Retrieves the format of the current audio input.
IsUISupported Checks if the SR engine supports a particular user interface component.
DisplayUI Displays a user interface component.
EmulateRecognition Emulates a recognition from a text phrase rather than from spoken audio.