ISpSREngineSite::Recognition

Microsoft Speech SDK

The Microsoft.com Speech website Microsoft Speech SDK SAPI 5.1

ISpSREngineSite::Recognition

ISpSREngineSite::Recognition returns a recognition result to SAPI.

HRESULT Recognition(
   SPRECORESULTINFO   *pResultInfo
);

Parameters

pResultInfo
[in] Pointer to type SPRECORESULTINFO indicating the results.

Return values

Value Description
S_OK Function completed successfully and to continue recognition.
S_FALSE Function completed successfully and the engine can terminate recognition without reading the rest of the stream.
FAILED (hr) Appropriate error message.

Remarks

The phrase can be either a hypothesis or a final result. If it is a hypothesis, a hypothesis event is issued to all interested recognition contexts. A final result event is issued to the target grammar that the result refers to. An engine can also send a false recognition with this method, indicating it has low confidence in the result.

If the return value from this call is S_FALSE, there are no more active rules and the engine is free to exit the RecognizeStream call without reading or processing any more data. Otherwise, the engine should continue reading data and continue recognition.

An ISpSREngineSite::AddEvent call with an SPEI_PHRASE_START parameter as the event type must precede the call to Recognition. For more details on this method, see the SR Engine Guide.