[VB.NET] Text to speech

420

Member
Reputation
0
You'll need a TextBox and Button.

TextBox = The text to be spoken.
Button = When you press it, it will speak the text in the TextBox.

Okay, here's the code:
Code:
Public Class Form1    
Dim SAPI

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        SAPI = CreateObject("sapi.spvoice")
        sapi.speak(TextBox1.Text)
    End Sub
End Class


Enjoy. :)
 
You'll need a TextBox and Button.

TextBox = The text to be spoken.
Button = When you press it, it will speak the text in the TextBox.

Okay, here's the code:
Code:
Public Class Form1    
Dim SAPI

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        SAPI = CreateObject("sapi.spvoice")
        sapi.speak(TextBox1.Text)
    End Sub
End Class


Enjoy. :)
 
DawnOfWar said:
Thanks for sharing this mate :D
This is rather interesting ^^

No problem. If you are having any problems/questions, feel free to ask me :)
 
Back
Top