Note
Please see Azure Cognitive Services for Speech documentation for the latest supported speech solutions.
Microsoft Speech Platform
ISpNotifySource
Applications can receive notifications when words have been spoken during speech synthesis or when words have been recognized during speech recognition. Speech Platform 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 Speech Platform 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 Speech Platform event notification does not require a window message pump.
Implemented By
- SpRecoContext (see ISpRecoContext)
- SpVoice (see ISpVoice)
- SpMMAudioIn (see ISpAudio)
- SpMMAudioOut (see ISpAudio)
- SpRecPlayAudio (see ISpAudio)
- SpStreamFormatConverter (see ISpStreamFormatConverter)
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. |