Home All Groups Group Topic Archive Search About

SAPI 5.1 SKI Question.

Author
3 Dec 2006 9:22 PM
pmclinn
With the Microsoft SDK can you use different voices like the AT&T
voices?  If so, does anyone have any code examples.

Author
3 Dec 2006 10:06 PM
Lucian Wischik
"pmclinn" <pmcl***@gmail.com> wrote:
>With the Microsoft SDK can you use different voices like the AT&T
>voices?  If so, does anyone have any code examples.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
  ' AddReference > COM objects > Microsoft Speech
  ' "Imports SpeechLib" at the top of your VB program
  Dim speech = New SpVoice
  Dim voices = speech.GetVoices()
  For i As Integer = 0 To voices.Count - 1
    Dim voice = voices.Item(i)
    ListBox1.Items.Add(voice.GetAttribute("Name") & " - " &
voice.GetAttribute("Language"))
  Next
  ' That listed the possibilities. But I'll hard-code this one for
now:
  speech.voice = speech.GetVoices("Name=LH Michelle",
"Language=409").Item(0)
  speech.Speak("Hello World", SpeechVoiceSpeakFlags.SVSFDefault)
  speech.WaitUntilDone(-1)
End Sub

--
Lucian
Author
4 Dec 2006 12:52 AM
Lucian Wischik
"pmclinn" <pmcl***@gmail.com> wrote:
>With the Microsoft SDK can you use different voices like the AT&T
>voices?  If so, does anyone have any code examples.

Note: normally the speech engine uses whichever voice the user had
selected in Start>ControlPanel>Speech>TextToSpeech. It might be a good
idea to just leave it at that... and if you want to give the user the
ability to choice a different voice, then link them to the control
panel.

--
Lucian