Thursday, 23 May 2013

Tutorial: Make VB.NET program speak using SAPI

 Tutorial: Make VB.NET program speak using SAPI

Code:
Public Class Form1
   Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
     Dim SAPI
     SAPI = CreateObject("SAPI.spvoice")
     SAPI.speak("Hello World!")
   End Sub
End Class

Run the program and you will hear a voice saying "Hello World!".

You can also direct it to Label's text (e.g.  SAPI.speak(Label1.Text)) and the text on the Label will be spoken.

If this post helped you please take few seconds to share it! :)

No comments:

Post a Comment