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

RetainedAudio Property


The RetainedAudio property gets and sets the audio retention status of the recognition context.

By default, a recognition context does not retain audio and is initially set to SRAONone. Calls attempting to access non-existent audio result in an SPERR_NO_AUDIO_DATA error. The calls ISpeechRecoResult.Audio and ISpeechRecoResult.SpeakAudio result in this error. The error can also occur when setting an SpAudioFormat instance.

To retain the audio, set this property to SRAORetainAudio.


Syntax

Set: SpeechRecoContext.RetainedAudio = SpeechRetainedAudioOptions
Get: SpeechRetainedAudioOptions = SpeechRecoContext.RetainedAudio

Parts

SpeechRecoContext
The owning object.
SpeechRetainedAudioOptions
Set: A SpeechRetainedAudioOptions constant that sets the property.
Get: A SpeechRetainedAudioOptions constant that gets the property.

Example

The following Visual Basic form code demonstrates the use of the ISpeechRecoContext.RetainedAudio. The application displays the text of the recognition along with the actual spoken part.

To run this code, create a form with the following control:

  • A command button called Command1
  • Paste this code into the Declarations section of the form.

    Public WithEvents RC As SpSharedRecoContext
    Public myGrammar As ISpeechRecoGrammar
    
    Private Sub Form_Load()
        Set RC = New SpSharedRecoContext
        RC.RetainedAudio = SRAORetainAudio
        Set myGrammar = RC.CreateGrammar
        
        myGrammar.DictationSetState SGDSActive
    End Sub
    
    Private Sub RC_Recognition(ByVal StreamNumber As Long, ByVal StreamPosition As Variant, ByVal RecognitionType As SpeechLib.SpeechRecognitionType, ByVal Result As SpeechLib.ISpeechRecoResult)
        Label1.Caption = Result.PhraseInfo.GetText
        Result.SpeakAudio
    End Sub
    


    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