This is a VBS Script to demonstrate text to speech capabilities. An inputBox pops up asking for text. The user types in any text and the user's computer will read the text aloud. This program should run on any computer running microsoft windows version Windows 98 or newer. To stop the script leave the inputBox blank. Add periods or commas to control the computer's speech rhythm.

There are more VBS Scripts on the VBS Scripts page.


textToSpeech.vbs

  1.  
  2. Dim var1
  3.  
  4. Do While 1 = 1 'this whole program will loop until you leave the input box blank'
  5. var1 = inputbox("Type Something:") 'this line causes a text input box to pop up'
  6. set sapi = wscript.createobject("SAPI.Spvoice")
  7. WScript.Sleep 100 'pauses the script for .1 seconds'
  8. Sapi.speak var1
  9.  
  10. If var1 = "" Then 'this line stops the loop'
  11. Exit Do
  12. End If
  13.  
  14. Loop
  15.