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

Voice Property


The Voice property gets and sets the currently active member of the Voices collection.

The Voice property can be thought of as the person of a voice object; examples of Voices are "Microsoft Mary" and "Microsoft Mike." Use the GetVoices method to determine what voices are available.


Syntax

Set: SpVoice.Voice = SpObjectToken
Get: SpObjectToken = SpVoice.Voice

Parts

SpVoice
The owning object.
SpObjectToken
Set: An SpObjectToken object that sets the voice property.
Get: An SpObjectToken object that gets the current voice.

Remarks

If there is not a voice currently in use, this property will return the token for the default voice.

Example

The following Visual Basic form code demonstrates the use of the GetVoices method and the Voice property. To run this code, create a form with the following controls:

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

    The Form_Load procedure creates a voice object, and displays the names of all available voices in the list box. Select a voice name in the list box and then click Command1; the Command1 procedure sets the voice object's Voice property to the selected name, and causes the voice to speak its new name.


    Option Explicit
    
    Private V As SpeechLib.SpVoice
    Private T As SpeechLib.ISpeechObjectToken
    
    Private Sub Command1_Click()
    
        If List1.ListIndex > -1 Then
        
            'Set voice object to voice name selected in list box
            'The new voice speaks its own name
            
            Set V.Voice = V.GetVoices().Item(List1.ListIndex)
            V.Speak V.Voice.GetDescription
            
        Else
            MsgBox "Please select a voice from the listbox"
        End If
            
    End Sub
    
    Private Sub Form_Load()
        Dim strVoice As String
        
        Set V = New SpVoice
        
        'Get each token in the collection returned by GetVoices
        For Each T In V.GetVoices
            strVoice = T.GetDescription     'The token's name
            List1.AddItem strVoice          'Add to listbox
        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