Advertisement
Yunga

Text-To-Speech.vbs

Aug 17th, 2015
386
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ' Use the speech api to say the clipboard content or the text entered in the input box
  2. Dim Message, Clip, SAPI
  3.  
  4. ' Get Clipboard Text
  5. Set objHTML = CreateObject("htmlfile")
  6. Clip        = objHTML.ParentWindow.ClipboardData.GetData("text")
  7.  
  8. If Clip = "" or IsEmpty(Clip) or IsNull(Clip) Then
  9.     Clip = "Hello World!"
  10. End If
  11.  
  12. ' User Input
  13. Message = InputBox("Enter your text:", "Say it!", Clip)
  14.  
  15. ' Speak
  16. Set SAPI    = CreateObject("sapi.spvoice")
  17. SAPI.Speak Message
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement