After updating the sdk to v11 and installing new TTS voices, I found one has to edit the Reg. Now all the voices show in the control <panel> Text-to-Speech and all the voices test.
I found an Article using SAPI in C# and all voices work; however; converting the C# to VB.net I get an error "Voice not Reg" Note:<window anna=""> works
Any on have a fix?
VB.Net
Add Reference
Microsoft Speech Object Library: V 11
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Text
Imports System.Windows.Forms
Imports SpeechLib
Imports System.Threading
Exploring the SpVoice class of MS SAPI 5.1 to use the various available features for TTS
' By Sabah u Din Irfan, Writen in C# above link
' Converted to VB.NET
Public Class Form1
Dim Speech As SpVoice
Dim Sp As Integer = -3 ' Speed +10 to -10
Dim Vl As Integer = 100 ' Volume 0 to 100
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Speech = CreateObject("SAPI.spvoice")
GetVoiceSaip()
TrackBar1.Value = Sp
lbSpeed.Text = TrackBar1.Value
TrackBar2.Value = Vl
lbVol.Text = TrackBar2.Value
End Sub
Private Sub GetVoiceSaip()
Try
cmbVoices.Items.Clear()
For Each Token As ISpeechObjectToken In Speech.GetVoices("", "")
cmbVoices.Items.Add(Token.GetDescription(49))
Next
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
cmbVoices.SelectedIndex = 0
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Speech.Volume = Vl
Speech.Rate = Sp
Try
Speech.Speak(TextBox1.Text, SpeechVoiceSpeakFlags.SVSFlagsAsync)
Catch ex As Exception
End Try
End Sub
Private Sub TrackBar1_Scroll(sender As Object, e As EventArgs) Handles TrackBar1.Scroll
lbSpeed.Text = TrackBar1.Value
Sp = TrackBar1.Value
End Sub
Private Sub TrackBar2_Scroll(sender As Object, e As EventArgs) Handles TrackBar2.Scroll
lbVol.Text = TrackBar2.Value
Vl = TrackBar2.Value
End Sub
Private Sub cmbVoices_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbVoices.SelectedIndexChanged
Speech.Voice = Speech.GetVoices("", "").Item(cmbVoices.SelectedIndex)
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
TextBox1.Clear()
End Sub
End Class