Windows Narrator.bat (Read from file)

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Boombox
Posts: 80
Joined: 18 Oct 2012 05:51

Windows Narrator.bat (Read from file)

#1 Post by Boombox » 01 Nov 2012 16:31

.

This one gets so far and stops... (Maybe text file is too long)

Code: Select all

@echo off
set /p read=<Readme.txt
echo strText = "%read%">words.vbs
echo Set objVoice = CreateObject("SAPI.SpVoice")>>words.vbs
echo objVoice.Speak strText>>words.vbs
wscript.exe "%cd%\words.vbs">nul
pause


This produces error... (File already open)

Code: Select all

@echo off
for /f %%g in (Readme.txt) do (
set read=%%g
echo strText = "%read%">words.vbs
echo Set objVoice = CreateObject("SAPI.SpVoice")>>words.vbs
echo objVoice.Speak strText>>words.vbs
wscript.exe "%cd%\words.vbs">nul)
pause


WTF!

EDIT:

Code: Select all

@echo off
for /f "tokens=*" %%g in (amanita.txt) do (
echo strText = "%%g">words.vbs)
echo Set objVoice = CreateObject("SAPI.SpVoice")>>words.vbs
echo objVoice.Speak strText>>words.vbs
wscript.exe "%cd%\words.vbs">nul


Nevermind, this works so far...

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Windows Narrator.bat (Read from file)

#2 Post by foxidrive » 01 Nov 2012 22:06

This seems better - how do you add a pause to the speech, such as the end of a line?

Code: Select all

@echo off
del words.vbs 2>nul
for /f "delims=" %%a in ('type "%~1"') do (
>>words.vbs echo strText = strText + "%%a"
)
echo Set objVoice = CreateObject("SAPI.SpVoice")>>words.vbs
echo objVoice.Speak strText>>words.vbs
wscript.exe "words.vbs">nul

Boombox
Posts: 80
Joined: 18 Oct 2012 05:51

Re: Windows Narrator.bat (Read from file)

#3 Post by Boombox » 02 Nov 2012 05:12

.
Pause? Delay after sentences..?

I just add extra periods . . .
As long as the period is alone. A short pause follows...

Have her read this line for you... Lol

yes. oh yes. oh baby, yes, yeah, that's it, right there, faster. yeah. yeah. yeah. yeah. yeah.

And thanks Foxi.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Windows Narrator.bat (Read from file)

#4 Post by foxidrive » 02 Nov 2012 05:16

LOL The speech says dotdotdotdotdot with a set of periods.

I found that if there is a trailing space then she doesn't pronounce dotdotdot. Ta.

Boombox
Posts: 80
Joined: 18 Oct 2012 05:51

Re: Windows Narrator.bat (Read from file)

#5 Post by Boombox » 02 Nov 2012 05:19

.

3 grouped together ... ?

But only connected to the previous word.

--

If anybody knows where I can get a different voice for this thing. Please speak up!

Boom.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Windows Narrator.bat (Read from file)

#6 Post by foxidrive » 02 Nov 2012 05:39

I separated them with spaces too. I guess it's fair because she'd have to say dotdotdot for ellipses.


Sponge Belly
Posts: 235
Joined: 01 Oct 2012 13:32
Location: Ireland
Contact:

Re: Windows Narrator.bat (Read from file)

#8 Post by Sponge Belly » 23 Nov 2012 04:17

Hi Boombox!

Have you tried Best Free Windows Narrator Voices? Some good links there.

There are also rumours that ETI Eloquence voices can be made to work with NVDA (an open source screen reader for Windows), but it's legally murky and I couldn't possibly comment further...

On a lighter note, you might get a chuckle out of JAWS vs NVDA (Harry Potter Style). Apparently, JAWS (the 800lb alpha-male orangutan of screen readers) has an achilles heel.

Hope this helps!

Post Reply