ISpNotifySource
In both speech synthesis and speech recognition, applications receive notifications when words have been spoken or when phrases have been recognized. SAPI components that generate notifications implement an ISpNotifySource.
The ISpNotifySource and ISpNotifySink interfaces alone only provide a mechanism for a notification but no information on the events that caused the notification. With an ISpEventSource object, an application can retrieve information about the events that caused the notification.
Applications will not typically use the free-threaded ISpNotifySink mechanism for receiving SAPI event notifications. They will use one of the simplified methods of either a window message, callback or Win32 event.
Note that both variations of callbacks as well as the window message notification require a window message pump to run on the thread that initialized the notification source. Callback will only be called as the result of window message processing, and will always be called on the same thread that initialized the notify source. However, using Win32 events for SAPI event notification does not require a window message pump.
Implemented By
- SpRecoContext
- SpSharedRecoContext
- SpVoice
- SpMMAudioIn
- SpMMAudioOut
- SpRecPlayAudio
- SpStreamFormatConverter
Methods in Vtable Order
ISpNotifySource Methods | Description |
---|---|
SetNotifySink | Sets up the instance to make free-threaded calls through ISpNotifySink::Notify. This method can also be used to unregister an existing notification. |
SetNotifyWindowMessage | Sets a window handle to receive notifications as window messages. |
SetNotifyCallbackFunction | Sets a callback function to receive notifications. |
SetNotifyCallbackInterface | Sets an object to receive notifications. |
SetNotifyWin32Event | Sets up a Win32 event object to be used by this instance for notifications. |
WaitForNotifyEvent | A blocking call which waits for a notification. |
GetNotifyEventHandle | Retrieves Win32 event handle associated with this notify source. |