![]() ![]() StrVoice = T. 'Get each token in the collection returned by GetVoices MsgBox "Please select a voice from the listbox" Set V.Voice = V.GetVoices().Item(List1.ListIndex) 'Set voice object to voice name selected in list box Private T As SpeechLib.ISpeechObjectToken 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. The Form_Load procedure creates a voice object, and displays the names of all available voices in the list box. Paste this code into the Declarations section of the form. ![]() To run this code, create a form with the following controls: The following Visual Basic form code demonstrates the use of the GetVoices method and the Voice property. Sign out and then sign back in for the new speech pack to be added to speech options. Select the speech options you want included with the language. If there is not a voice currently in use, this property will return the token for the default voice. Select the language you want to add speech to, and then select the Next button. Get: An SpObjectToken object that gets the current voice. SpObjectToken Set: An SpObjectToken object that sets the voice property. 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. The Voice property gets and sets the currently active member of the Voices collection. Previous page next page Microsoft Speech Platform ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |