Note
Please see Azure Cognitive Services for Speech documentation for the latest supported speech solutions.
Microsoft Speech Platform
ISpRecognizer::SetRecognizer
ISpRecognizer::SetRecognizer specifies the recognizer token to use.
<pre IsFakePre="true" xmlns="http://www.w3.org/1999/xhtml"> <strong>HRESULT SetRecognizer(</strong><a runat="server" href="jj127672(v=msdn.10).md"><strong>ISpObjectToken</strong></a> *<em>pEngineToken</em> <strong>);</strong> </pre>
Parameters
- pEngineToken
[in] The object token to use for speech recognition engine.
Return Values
Value | Description |
---|---|
S_OK | Function completed successfully. |
E_INVALIDARG | pEngineToken is invalid or bad. |
SPERR_ENGINE_BUSY | Recognition is currently running. |
FAILED(hr) | Appropriate error message. |
Remarks
This method allows the application to select a specific engine object token to use for speech recognition (SR). For example, the method SpFindBestToken could be used to find an engine that supports certain attributes, and the resulting token could be passed to this method.
- If this method is not called, the Speech Platform will use the current default SR engine.
- If this method is passed NULL, the Speech Platform will switch to the current default SR engine.
This method cannot be called when the current SR engine is already running and processing audio.