Page 1 of 1

Talking with a speech synthesizer

Posted: 12 Dec 2015 11:00
by THAT BATCH GUY
i usually dont need help :oops: but this code line wont work :? ...help
the codez:

Code: Select all

@echo off
:start
echo set speech = Wscript.CreateObject("SAPI.spVoice") >> "temp.vbs"
echo hello what should i say?
set /p talk =

set text=%talk%
echo speech.speak "%text%" >> "temp.vbs"
start temp.vbs
ping localhost -n 10 >nul
del temp.vbs
exit

Re: TALKING PROBLEM

Posted: 12 Dec 2015 13:57
by Squashman

Code: Select all

set /p talk=

Re: TALKING PROBLEM

Posted: 12 Dec 2015 15:38
by npocmaka_
shorter:

Code: Select all

@echo off

set /p "to_say=enter a text :"

mshta "javascript:code(close((V=(v=new ActiveXObject('SAPI.SpVoice')).GetVoices()).count&&v.Speak('%to_say%')))"

Re: TALKING PROBLEM

Posted: 12 Dec 2015 16:00
by Aacini
Simpler? 8)

Code: Select all

@set @a=0 /* & set /P "talk=Enter a text: "
@CScript //nologo //E:JScript "%~F0" "%talk%" & goto :EOF */

WScript.CreateObject("SAPI.SpVoice").Speak(WScript.Arguments(0))

Antonio