ISpRecognizer::SetRecognizer (SAPI 5.3)

Speech API 5.3
Microsoft Speech API 5.3


ISpRecognizer::SetRecognizer specifies the particular speech recognition engine to be used.

HRESULT SetRecognizer(
   ISpObjectToken   *pEngineToken


[in] The object token referring to the speech recognition engine to be used.

Return values

S_OKFunction completed successfully.
E_INVALIDARGpEngineToken is invalid or bad.
SPERR_ENGINE_BUSYRecognition is currently running or other applications are connected to the shared recognizer.
FAILED(hr)Appropriate error message.


This method allows the application to select a particular engine object token to be used (For example, the method SpFindBestToken could be used to find an engine supporting certain attributes, and the resulting token could be passed to this method).

If this method is not called, SAPI will use the current default SR engine.

If this method is passed NULL, SAPI will switch to the current default SR engine.

This method cannot be called when the current SR engine is already running and processing audio. In addition, when using the shared recognizer, it cannot be called if another application is also using the shared recognizer.