Share via


ISpRecognizer::GetRecoState

Other versions of this page are also available for the following:

Windows Mobile Not SupportedWindows Embedded CE Supported

8/28/2008

This method gets the current state of the SR engine.

This method shows whether audio is currently being read from the audio input stream and passed to the SR engine.

See also ISpRecognizer::SetRecoState.

Syntax

HRESULT GetRecoState(
  SPRECOSTATE* pState
);

Parameters

  • pState
    [out] Pointer to the current state of the SR engine. Possible values are defined for the SPRECOSTATE enumeration.

Return Value

The following table shows the possible return values.

Value Description

S_OK

Function completed successfully.

E_INVALIDARG

Invalid pointer.

FAILED(hr)

Appropriate error message.

Remarks

The default recognizer state is SPRST_ACTIVE, which means SAPI will start the audio input stream only when at least one top-level rule is active.

If you would like to be notified when the recognizer state changes (for example, another application changes the shared SR engine's recognizer state), rather than polling the state with GetRecoState, you can call ISpEventSource::SetInterest with SPEI_RECO_STATE.

Requirements

Header sapi.h, sapi.idl
Library sapilib.lib
Windows Embedded CE Windows CE .NET 4.1 and later

See Also

Reference

ISpRecognizer
SAPI Interfaces