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


Intelligent Interface Technologies Home Page Microsoft Speech SDK

Speech Automation 5.1

Interface: ISpeechRecoContext

Pause Method


The Pause method pauses the engine object to synchronize with the speech recognition (SR) engine.

Pause stops the SR engine at a synchronization point to change grammars and rule states. A synchronization point occurs after any Recognition event, Bookmark event or as soon as possible after explicitly calling Pause. After synchronizing grammars and rule states, the engine continues recognizing if Resume is called.

After the application has changed the state or grammar, it should call ISpeechRecoContext.Resume. A call to Resume must be made for every call made to Pause. SAPI will automatically feed the buffered audio data into the SR engine, ensuring that no real-time audio data is lost and that the user experience is not interrupted. SAPI will restart the SR engine once Resume has been called.

During the pause, SAPI continues to collect and store audio input in an audio buffer. The SAPI audio buffer has a static limit to prevent SAPI applications or SR engines from consuming large amounts of system memory. If the speech recognition engine pauses too long, and the audio buffer fills, then a buffer overflow (SPERR_AUDIO_BUFFER_OVERFLOW) occurs. This would result in interruptions of other applications running SAPI. The buffer is set to 30 times the average bytes per second or approximately 30 seconds. Consequently, the audio data collected between the point when the buffer overflow occurred, and when the stream was reactivated, will be completely lost. Use Pause only for very short periods and call Resume immediately once grammars and rules states have changed.

SpeechRecoContext.Pause()

Parameters

None.

Return Value

None.


Remarks

Grammar and rule state changes can be requested while the SR engine is running. However, the changes will not take place until the engine stops and synchronizes. Since a Recognition event is a common synchronization point, in many situations, it may not be necessary to call Pause. However, if the grammar or state change needs to be implemented immediately, call Pause, make the change and then call Resume.

The SAPI 5 SR engine synchronizes close to every 60 seconds, which aids in timely shutdowns and avoids problems with loud and continuous background noises. There is no requirement for other manufacturer's engines to also synchronize like this although it is encouraged.

Example

The following code snippet demonstrates uses Pause and Resume. The example code is Paused allowing the user to change the state or grammar.

Public WithEvents RC As SpSharedRecoContext
Set RC = New SpSharedRecoContext

'setup the recognition context
'...

'pause the context so that event notifications are not received
RC.Pause

'[quickly] perform the processing, as stated above
'...

RC.Resume
'applications will start receiving event notifications again


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