VB.NET
* Imports System.Speech.Synthesis
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim spk As SpeechSynthesizer
For Each voice As InstalledVoice In spk.GetInstalledVoices
ListBox1.Items.Add(voice.VoiceInfo.Name)
Next
ListBox1.SelectedIndex = 0
TextBox1.Text = "Hello"

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim spk As New SpeechSynthesizer
spk.SelectVoice(ListBox1.SelectedItems.ToString)
spk.Speak(TextBox1.Text)
End Sub
End Class 

 

 

* 영어 문장을 읽어주는 프로그램 이다

* .net framework 3.0 이상 환경에서 만든다

 

# 실행하면 아래 그림과 같은 에러가 뜬다 / 해결해보자

1.png