ISpSREngineSite::AddEvent

Microsoft Speech SDK

The Microsoft.com Speech website Microsoft Speech SDK SAPI 5.1

ISpSREngineSite::AddEvent

ISpSREngineSite::AddEvent sends an event back from the engine to applications.

For more details on this method and the different events that can be fired, see the SR Engine Guide.

HRESULT AddEvent(
   const   SPEVENT       *pEvent,
   SPRECOCONTEXTHANDLE    hContext
);

Parameters

pEvent
[in] Address of the SPEVENT structure containing the event information.
hContext
[in] The RecoContext is the event handle passed to SR engine from SAPI through ISpSREngine::OnCreateRecoContext. This value should normally be set to NULL indicating the event is a global one.

Return values

Value Description
S_OK Function completed successfully.
E_INVALIDARG At least one of pEvent or hContext is invalid or bad. Alternatively, it indicates that an event is being added to an inappropriate mode.
E_POINTER Invalid pointer.
SPERR_STREAM_POS_INVALID The current audio stream offset is greater than either the current seek position or the last sync position. Alternatively, if the event stream is not initialized, the stream position is not zero.
FAILED(hr) Appropriate error message.