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 Events

Hypothesis Event


The Hypothesis event occurs when the SR engine produces a hypothesis.

A hypothesis is an interim recognition result. Each time the engine attempts a recognition it generates an interim results and Hypothesis events are sent out. A hypothesis may or may not be close to the final version of the recognition. In fact, a hypothesis may not bear any likeness to the final result due to the sound quality, idiomatic phrasing, or uncommon word or phrase usage.

The member Result is a valid recognition result and may be used in the same way as a Recognition event. However, the values are interim and could change for the next Hypothesis event.


SpeechRecoContext.Hypothesis(
     StreamNumber As Long,
     StreamPosition As Variant,
     Result As ISpeechRecoResult
)

Parameters

StreamNumber
Specifies the stream number.
StreamPosition
Specifies the position within the stream.
Result
An ISpeechRecoResult object containing the recognition results.

Example

The following Visual Basic form code demonstrates the use of the Hypothesis event. The application displays all the hypotheses for the current recognition attempt and then displays the final recognition.

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

  • Two labels called Label1 and Label2
  • Paste this code into the Declarations section of the form.

    The Form_Load procedure creates and activates a dictation grammar. The PhraseStart event clears the display each time so the current hypothesis is displayed. For longer recognitions, a larger Label1 may be used or changed to a scrolling text box.

    Public WithEvents RC As SpSharedRecoContext
    Public myGrammar As ISpeechRecoGrammar
    
    Private Sub Form_Load()
        Set RC = New SpSharedRecoContext
        
        Set myGrammar = RC.CreateGrammar
        myGrammar.DictationSetState SGDSActive
    End Sub
    
    Private Sub RC_Hypothesis(ByVal StreamNumber As Long, ByVal StreamPosition As Variant, ByVal Result As SpeechLib.ISpeechRecoResult)
        Label1.Caption = Label1.Caption & Result.PhraseInfo.GetText & vbCrLf
    End Sub
    
    Private Sub RC_PhraseStart(ByVal StreamNumber As Long, ByVal StreamPosition As Variant)
        Label1.Caption = ""
    End Sub
    
    Private Sub RC_Recognition(ByVal StreamNumber As Long, ByVal StreamPosition As Variant, ByVal RecognitionType As SpeechLib.SpeechRecognitionType, ByVal Result As SpeechLib.ISpeechRecoResult)
        Label2.Caption = Result.PhraseInfo.GetText
    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