1. Start by making a new project by going to (File > New Project) and then click Windows Form Application and for the name type Text to Speech.
2. Next double click your form anywhere and type in
Code:
Dim SAPI
SAPI = CreateObject("sapi.spvoice")
SAPI.Speak("Welcome to Speech")
This will make your program say Welcome to Speech when it opens, it will literally say it.
4. Now drag a text box and 2 buttons.
5. In the properties window of button one, make it say 'Speak' for the text.
6. Make button 2 say 'Close' and then double click it and type in: me.close()
7. Double click button one or the 'Speak' button and type in
Code:
Dim SAPI
SAPI = CreateObject("sapi.spvoice")
SAPI.Speak(TextBox1.Text)
8. Press F5 and type something in your text box.
9. Click your 'Speak' button and it should say what you wrote.
Heres the what the code should look like for button one
Code:
PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim SAPI
SAPI = CreateObject("sapi.spvoice")
SAPI.Speak(TextBox1.Text)
EndSub