text-to-speech problem

Z

zoneal

i'm developing a text-to-speech for my system. i use the text-to-speech
component from the .net. but the voice sometimes is mary and sometimes
is sam. Is there any way to default the voice i use in vb.net.

thanks
 
K

Ken Tucker [MVP]

Hi,

I use the speech sdk 5.1 for text to speech. Here is how you could
set the voice to LH Michelle.

Dim tts As SpeechLib.SpVoice

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
tts = New SpeechLib.SpVoice
Dim tMichelle As SpeechLib.SpObjectToken
For Each t As SpeechLib.ISpeechObjectToken In tts.GetVoices
Trace.WriteLine(t.GetDescription.ToString)
If t.GetDescription.ToString = "LH Michelle" Then tMichelle =
CType(t, SpeechLib.SpObjectToken)
Next

tts.Voice = tMichelle
btnSay.PerformClick()
End Sub

Private Sub btnSay_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSay.Click
tts.Speak(txtSpeak.Text,
SpeechLib.SpeechVoiceSpeakFlags.SVSFlagsAsync)
End Sub

Ken
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top