Text To Speech using VB Script

You know the beauty of this program, it dont expect you to download any external .dll or jar or anything, all you have to do is write 4 lines of code and your Text to Speech program is ready, yes you read it right. Lets see how.

Open a notepad, Type below code in it :

Dim message, sapi
message = InputBox("Write something and I will say it for you"+vbcrlf)
Set sapi= CreateObject("sapi.spvoice")

sapi.Speak message


Save the notepad file with .vbs extension, you will notice that the file icon is changed to VB Script icon. Now open the file again, it will open a window like below. 


Type any text in the text box and it will say it for you..Bingo....!

Comments

Popular posts from this blog

Integer.MAX_VALUE, Double.POSITIVE_INFINITY and Double.NaN in Java