ISpRecognizer::SetRecognizer (Windows CE 5.0)

Send Feedback

This method specifies the particular SR engine to use with the recognizer. 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, then 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.

HRESULT SetRecognizer(ISpObjectToken* pEngineToken);

Parameters

  • pEngineToken
    [in] Pointer to an object implementing ISpObjectToken for the SR engine to be used.

Return Values

The following table shows the possible return values.

Value Description
S_OK Function completed successfully.
E_INVALIDARG pEngineToken is invalid or bad.
SPERR_ENGINE_BUSY Recognition is currently running or other applications are connected to the shared recognizer.
FAILED(hr) Appropriate error message.

Requirements

OS Versions: Windows CE .NET 4.1 and later.
Header: Sapi.h, Sapi.idl.
Link Library: Sapilib.lib.

See Also

ISpRecognizer | SAPI Interfaces

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.