Note
Please see Azure Cognitive Services for Speech documentation for the latest supported speech solutions.
Microsoft Speech Platform
ISpRecoContext::SetVoicePurgeEvent
ISpRecoContext::SetVoicePurgeEvent sets the speech recognition engine events that stop audio output, and purges the current speaking queue.
<pre IsFakePre="true" xmlns="http://www.w3.org/1999/xhtml"> <strong>HRESULT SetVoicePurgeEvent(</strong> <strong> ULONGLONG</strong> <em>ullEventInterest</em> <strong>);</strong> </pre>
Parameters
- ullEventInterest
[in] The set of flags indicating the event interest(s). The event interest(s) must be in the set of speech recognition events (that is, between SPEI_MIN_SR and SPEI_MAX_SR) (see SPEVENTENUM and SPFEI_ALL_SR_EVENTS)
Return Values
Value | Description |
---|---|
S_OK | Function completed successfully. |
E_INVALIDARG | One or more of the event interests set is not allowed. |
FAILED(hr) | Appropriate error message. |
Remarks
The ISpRecoContext event interest will be updated to include the Voice Purge Events (see ISpEventSource::SetInterest).
To find the current Voice Purge Event(s), use ISpRecoContext::GetVoicePurgeEvent
Applications can call SetVoicePurgeEvent when implementing "barge-in" type functionality. For example, when a user calls a telephony server, and the server uses TTS Voice prompts, the Voice should stop speaking when the user is speaking. The application would want the associated Voice object of the ISpRecoContext (see ISpRecoContext::GetVoice) to stop and purge when the speech recognition engine hears a sound (see SPEI_SOUND_START).