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

Object: SpObjectTokenCategory

EnumerateTokens Method

The EnumerateTokens method returns a selection of SpObjectToken objects.

Selection criteria may be applied optionally.


SpObjectTokenCategory.EnumerateTokens(
     [RequiredAttributes As String = ""],
     [OptionalAttributes As String = ""]
) As ISpeechObjectTokens

Parameters

RequiredAttributes
[Optional] Specifies the RequiredAttributes. To be returned by EnumerateTokens, the searched tokens must contain all of the specific required attributes. If no profiles match the selection, the selection returned will not contain any elements. By default no attributes are required and so returns all the tokens discovered.
OptionalAttributes
[Optional] Specifies the OptionalAttributes. Returned tokens containing the RequiredAttributes are sorted by OptionalAttributes. If OptionalAttributes is specified, the tokens are listed with the OptionalAttributes first. By default no attribute is specified so the list returned is in the order discovered from the speech configuration database.

Return Value

The EnumerateTokens method returns an ISpeechObjectTokens variable.


Example

The following Visual Basic form code demonstrates a simple use of the EnumerateTokens method. To run this code, create a form with the following controls:

  • A list box called List1
  • Two command buttons called Command1 and Command2
  • Paste this code into the Declarations section of the form.

    The Command1 procedure creates an SpVoice object, and uses the voice's GetVoices method to get an ISpeechObjectTokens collection containing an object token for each voice on the computer. A "For Each" loop lists each voice token's Description property in the list box.

    The Command2 procedure creates a new SpObjectTokenCategory object, uses the SetId method to associate it with the category of voices, and the EnumerateTokens method to get an ISpeechObjectTokens collection containing an object token for each voice on the computer. A "For Each" loop lists each voice token's Description property in the list box.

    The list of voices displayed by the two command buttons will be identical.


    Option Explicit
    
    Dim V As SpeechLib.SpVoice                  'voice object
    Dim T As SpeechLib.SpObjectToken            'object token
    Dim E As SpeechLib.ISpeechObjectTokens      'an enumeration of object tokens
    Dim C As SpeechLib.SpObjectTokenCategory    'a category of object tokens
    
    Private Sub Command1_Click()
        
        List1.Clear
        List1.AddItem "Enumerate voices with SpVoice.GetVoices"
        List1.AddItem ""
        
        Set V = New SpVoice                 'create new voice
        Set E = V.GetVoices()               'no parameters -- get all voices
        
        For Each T In E
            List1.AddItem "   " & T.GetDescription
        Next
        
    End Sub
    
    Private Sub Command2_Click()
    
        List1.Clear
        List1.AddItem "Enumerate voices with SpObjectToken.EnumerateTokens"
        List1.AddItem ""
        
        Set C = New SpObjectTokenCategory   'create new token category object
        C.SetId SpeechCategoryVoices        'init ID of voices category
        Set E = C.EnumerateTokens()         'no parameters -- get all voices
        
        For Each T In E
            List1.AddItem "   " & T.GetDescription
        Next
    
    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