How to make the computer talk from any batch file

It is possible to make the computer talk by a batch file or any windows program. All is needed is a tiny VBScript file that use Microsoft Speech API OLE Object. Also all sentences passed to the command must be surrounded with quotes. Otherwise it will not sound the best.

You may download, copy, modify the VBScript file.

' delphijustin Say v1.0
' Website https://delphijustin.biz
Set sentences = Wscript.Arguments
if sentences.Count=1 then
if sentences(0)="/?" then
Wscript.Echo "Usage: "&Wscript.ScriptName&" <messages>"
Wscript.Quit 0
end if
end if
set sapi = CreateObject("SAPI.SpVoice")
For Each sentence In sentences
  sapi.Speak sentence, 0
Next
if sentences.Count=0 then
sapi.Speak "I don't know what to say.", 0
end if

Published by Justin Roeder

I am an electronics engineer and computer programmer that has autism. I learned by myself

delphijustin Industries is an Autism Supported Business
Social Media Auto Publish Powered By : XYZScripts.com
All in one
Start
China Unicom Hebei Province Network HE Zhangjiakou
Your cart is empty.
Loading...