Share via


Note

Please see Azure Cognitive Services for Speech documentation for the latest supported speech solutions.

Microsoft Speech Platform

ISpNotifyTranslator::InitWin32Event

ISpNotifyTranslator::InitWin32Event sets up a Win32 event object to be used by this instance.

<pre IsFakePre="true" xmlns="http://www.w3.org/1999/xhtml"> <strong>HRESULT InitWin32Event(</strong> <strong> HANDLE</strong> <em>hEvent</em>, <strong> BOOL</strong> <em>fCloseHandleOnRelease</em> <strong>);</strong> </pre>

Parameters

  • hEvent
    Handle of an existing Win32 event object for the application to use with ISpNotifyTranslator. If this parameter is NULL, a new event will be created.
  • fCloseHandleOnRelease
    Specifies whether the hEvent handle should be closed when the object is released. If hEvent is NULL, this parameter is ignored and the handle will always be closed upon release of the object.

Return Values

Value Description
S_OK Function completed successfully.
SPERR_ALREADY_INITIALIZED Interface is already initialized.
FAILED(hr) Appropriate error message.

Remarks

The translator will call the Win32 method ::SetEvent() whenever the translator's Notify() method is called.

Initialize an event object for this instance, and then use either the WaitForNotifyEvent or GetNotfyEventHandle method. Win32 event objects and Speech Platform events are different. This method is similar to ISpNotifySource::SetNotifyWin32Event.