vb: how to read out text (text to speech)?
This site provides users with the information about vb, visual basic, vb6, text to speech, how to speak text, read out text, make computer speak, how to create program to speak, make pc talk, example, and more.
If you think that this site is helpful, please recommend your friends to visit our site.
How to read out text (text to speech) in vb?
The following is the code and steps for reading out text (text to speech) in vb:
1. Add Microsoft Speech Object Library from References.
2. Create a button and add the following code in it.
Private Sub Command1_Click()
Dim objVoice As Object
Dim userInput As String
userInput = InputBox("Type anything to be spoken out in the following:")
Set objVoice = CreateObject("SAPI.spVoice")
Set objVoice = Nothing