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::Resume

ISpRecoContext::Resume releases the SR engine from the paused state and restarts the recognition process.

HRESULT  Resume (
  DWORD dwReserved
);

Parameters

dwReserved
[in] Reserved, must be zero.

Return values

Value Description
S_OK Function completed successfully.
E_INVALIDARG dwFlags is not set to zero.

Remarks

This method must be called after a call to ISpRecoContext::Pause, a bookmark event occurs that pauses the recognition engine, or an auto-pause rule is recognized (see ISpRecoGrammar::SetRuleState).

The caller must call Resume once for every call that is made to ISpRecoContext::Pause.

Example

The following code snippet illustrates the use of ISpRecoContext::Resume after a call to ISpRecoContext::Pause

    HRESULT hr = S_OK;

    // setup the recognition context
    // ...

    // pause the context so that event notifications are not received
    hr = cpRecoContext->Pause( NULL );
    // Check hr

    // [quickly] perform the processing - see ISpRecoContext::Pause Remarks section
    // ...

    hr = cpRecoContext->Resume( NULL );
    // Check hr

    // applications will start receiving event notifications again

The following code snippet illustrates the use of ISpRecoContext::Resume with an "auto-pause" rule.

    HRESULT hr = S_OK;

    // setup the recognition context and grammar
    // ...

    // activate a top-level rule as an "auto-pause" rule
    hr = cpRecoGrammar->SetRuleState( MY_AUTOPAUSE_RULE, NULL, SPRS_ACTIVE_WITH_AUTO_PAUSE);
    // Check hr

    // get the recognition event for MY_AUTOPAUSE_RULE in a CSpEvent object
    // ...

    // assert that the recognition context paused after the "auto-pause" rule was recognized
    SPDBG_ASSERT(spEvent.IsPaused());

    // deactivate the "auto-pause" rule
    hr = cpRecoGrammar->SetRuleState( MY_AUTOPAUSE_RULE, NULL, SPRS_INACTIVE );
    // Check hr

    // activate the second rule
    hr = cpRecoGrammar->SetRuleState( MY_SECOND_RULE, NULL, SPRS_ACTIVE );
    // Check hr

    // Since the context was paused from the "auto-pause" rule, it must now be reactivated to recognize the second rule
    hr = cpRecoContext->Resume( NULL );
    // Check hr

    // get the second recognition... 


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