Kartikey Sapra
This guide will explain how very easy to talk to your PC:
1) Insert a TextBox and a CommandButton.
2) Insert this code:
For VB6:

Sub Command1_Click()
Dim strSpeech As String
strSpeech = Text1.text
Set ObjSpeech = CreateObject ("SAPI.SpVoice")
ObjSpeech.Speak strSpeech
End Sub


For VB8:


Private Sub 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)
End Sub
3)Enjoy!
0 Responses

Post a Comment