Simple Text To Speech VB.NET
Simple Text To Speech VB.NET
FORM 1
Imports System.Speech.Synthesis
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim synth As New SpeechSynthesizer
synth.Rate = TrackBar2.Value
synth.Volume = TrackBar1.Value
If ComboBox1.SelectedIndex = 0 Then
synth.SelectVoiceByHints(VoiceGender.Male)
ElseIf ComboBox1.SelectedIndex = 1 Then
synth.SelectVoiceByHints(VoiceGender.Female)
End If
synth.Speak(RichTextBox1.Text)
End Sub
Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
End Sub
End Class

Comments
Post a Comment