CHMlib Logo Leading Translation Management System for Translation Agencies, Top Translation Management Software for Freelance Translators, Time Tracking Software, Word Count, Character Count and Line Count Software, Computer Assisted Translation Tool for Easy Word Count, Clipboard Character Count Software, User-Friendly Translation Memory Software, Terminology Management Software, Terminology Management Server, Microsoft Glossary Software, Dictionary of Acronyms, Social Network for Translators and Translation Agencies, Acronyms and Abbreviations Search Engine, Russian Translation Lab, Ukrainian Translation Lab.
You are reading help file online using chmlib.com
CrisisHelper - First Aid in Tough Times of World Economic Crisis


The Microsoft.com Speech website Microsoft Speech SDK

SAPI 5.1

ISpRecoContext::SetVoicePurgeEvent

ISpRecoContext::SetVoicePurgeEvent sets the SR engine events that stop audio output, and purges the current speaking queue.

HRESULT SetVoicePurgeEvent(
   ULONGLONG   ullEventInterest
);

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 (i.e., 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 SR engine hears a sound (see SPEI_SOUND_START).

Example

The following code snippet illustrates the use of ISpRecoContext::SetVoicePurgeEvent and "barge-in" setup

    HRESULT hr = S_OK;

    // create a shared recognition context
    hr = cpRecoContext.CoCreateInstance(CLSID_SpSharedRecoContext);
    // Check hr

    // create a voice from the context (with same audio format as context)
    hr = cpRecoContext->GetVoice(&cpVoice);
    // Check hr

    // tell the associated Voice to stop speaking when the SR Engine hears a recognizable sound
    hr = cpRecoContext->SetVoicePurgeEvent(SPFEI(SPEI_SOUND_START));
    // Check hr


You are reading help file online using chmlib.com

If you want your help file to be removed or added please send e-mail to chmlibcom@gmail.com
Partner sites: Logo Design, Simple Anti-Crisis Accounting Software, Voice Search for Web