ISpRecognizer2::EmulateRecognitionEx (Microsoft Speech Platform)

Microsoft Speech Platform SDK 11

Microsoft Speech Platform

ISpRecognizer2::EmulateRecognitionEx

ISpRecognizer2::EmulateRecognitionEx emulates a recognition from a specified phrase rather than from spoken content and extends the functionality of ISpRecognizer::EmulateRecognition.

HRESULT EmulateRecognitionEx(
   ISpPhrase   *pPhrase,
   DWORD        dwCompareFlags   
);

Parameters

pPhrase
The phrase containing the words to emulate (that is, pretend the user said this string).
dwCompareFlags
Determines how the comparison is to be performed. The values are LINGUISTIC_IGNORECASE, LINGUISTIC_IGNOREDIACRITIC, NORM_IGNORECASE, NORM_IGNOREKANATYPE, NORM_IGNORENONSPACE, NORM_IGNORESYMBOLS, NORM_IGNOREWIDTH, NORM_LINGUISTIC_CASING, and SORT_STRINGSORT. These values are identical to those used for the dwCmpFlags parameter of the CompareString function. For more information, see CompareString.

Return values

Value Description
S_OK Function completed successfully.
E_INVALIDARG pPhase is invalid.
SP_NO_PARSE_FOUND The phrase did not match any active rules.
SP_RECOGNIZER_INACTIVE Recognition is not currently active, so emulation cannot complete.
FAILED(hr) Appropriate error message.