Talking with a speech synthesizer

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
THAT BATCH GUY
Posts: 1
Joined: 12 Dec 2015 10:50

Talking with a speech synthesizer

#1 Post by THAT BATCH GUY » 12 Dec 2015 11:00

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

Squashman
Expert
Posts: 4465
Joined: 23 Dec 2011 13:59

Re: TALKING PROBLEM

#2 Post by Squashman » 12 Dec 2015 13:57

Code: Select all

set /p talk=

npocmaka_
Posts: 512
Joined: 24 Jun 2013 17:10
Location: Bulgaria
Contact:

Re: TALKING PROBLEM

#3 Post by npocmaka_ » 12 Dec 2015 15:38

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%')))"

Aacini
Expert
Posts: 1885
Joined: 06 Dec 2011 22:15
Location: México City, México
Contact:

Re: TALKING PROBLEM

#4 Post by Aacini » 12 Dec 2015 16:00

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

Post Reply