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

Recognizer Property


The Recognizer property specifies characteristics about the active recognizer.

Recognizers and the attributes associated with them are stored in the speech configuration database as a series of tokens, with each token representing one attribute. Recognizer retrieves an object (SpObjectToken) which is capable of accessing the attributes for the recognizer. Additional or more detailed information about the tokens is available in methods associated with SpObjectToken.

See Object Tokens and Registry Settings White Paper for a list of SAPI 5-defined engine attributes.


Syntax

Set: SpeechRecognizer.Recognizer = SpObjectToken
Get: SpObjectToken = SpeechRecognizer.Recognizer

Parts

SpeechRecognizer
The owning object.
SpObjectToken
Set: An SpObjectToken variable that sets the property.
Get: An SpObjectToken variable that gets the property.

Example

This code sample demonstrates the Recognizer property. After creating an instance for a recognizer, the Recognizer property can retrieve attribute information about the active recognizer. The engine ID is displayed. Also two attributes are attempted to be displayed. The first is "SpeakingStyle" (an attribute for the SAPI 5 SR engine. The other is "MyEngineAttribute," and should not be present. Tokens not found will cause a run-time error and as a result, require the error handling code.

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 the recognizer.

    Public WithEvents RC As SpSharedRecoContext
    Public myGrammar As ISpeechRecoGrammar
    
    Private Sub Form_Load()
        On Error GoTo TokenNotFound
        Set RC = New SpSharedRecoContext
        
        Set myGrammar = RC.CreateGrammar
        myGrammar.DictationSetState SGDSActive
        
        Label1.Caption = RC.Recognizer.Recognizer.Id & vbCrLf
        
        Dim objectToken As SpObjectToken
        Set objectToken = RC.Recognizer.Recognizer
        
        Dim tokenName As String
        tokenName = "SpeakingStyle"
        Label1.Caption = Label1.Caption & tokenName & " : " & objectToken.GetAttribute(tokenName) & vbCrLf
        
        tokenName = "MyEngineAttribute"
        Label1.Caption = Label1.Caption & tokenName & " : " & objectToken.GetAttribute(tokenName) & vbCrLf
        Exit Sub
        
    TokenNotFound:
        Label1.Caption = Label1.Caption & tokenName & " : " & "Token not found"
    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