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

Recognition Event


The Recognition event occurs when the speech recognition (SR) engine produces a recognition.

This could be considered the most important event for speech recognition because it returns the result of a successful recognition. A successful recognition is recognized a word or phrase that is matched in an open grammar for that recognition context and whose quality of speech meets a minimum confidence score. If neither criteria is met, the engine returns a FalseRecognition event. Spoken content may not meet the confidence score for several reasons including background interference, inarticulate speech or an uncommon word or phrase.

The member Result contains the recognition result object and from that may derive much of the information about the speech.


SpeechRecoContext.Recognition(
     StreamNumber As Long,
     StreamPosition As Variant,
     RecognitionType As SpeechRecognitionType,
     Result As ISpeechRecoResult
)

Parameters

StreamNumber
Specifies the stream number owning the recognition.
StreamPosition
Specifies the position within the stream.
RecognitionType
A SpeechRecognitionType constant that specifies the RecognitionType or the recognition state of the engine.
Result
An ISpeechRecoResult object containing the recognition results.

Remarks

There are three possible results from a recognition attempt:

  1. The first, a Recognition event is the result of a successful recognition. This event indicates that the word or phrase was matched to elements in an open grammar, and that the match had a sufficiently high confidence rating.
  2. The second possible result is a FalseRecognition event. This event indicates that speech was detected but it either did not match words in an open grammar, or the match did not merit a high enough confidence rating. The recognition result returned with a FalseRecognition is still valid and contains all the information of a Recognition event, including the text.
  3. The third possible result is RecognitionForOtherContext event. This event indicates a successful recognition result, but a different recognition context was used to match words. SAPI attempts to match the word or phrase in the current recognition context. However, if no match is possible (perhaps the recognition context is currently inactive, the rule is inactive, or the word or phrase is simply not included in the grammar), SAPI then attempts to find a match in other recognition contexts. If a match is found in another application whose grammar is available, the Recognition event is sent to that application instead and the current application receives a RecognitionForOtherContext event.

Example

The following Visual Basic form code demonstrates the use of the Recognition event. The application displays the text of a successful recognition.

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

  • A label called Label1
  • Paste this code into the Declarations section of the form.

    The Form_Load procedure creates and activates a dictation grammar.

    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_Recognition(ByVal StreamNumber As Long, ByVal StreamPosition As Variant, ByVal RecognitionType As SpeechLib.SpeechRecognitionType, ByVal Result As SpeechLib.ISpeechRecoResult)
        Label1.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