Page 1 of 1

espeak

Posted: Sun Mar 23, 2014 2:25 pm
by stujol
Can espeak read a text document?

I've tried espeak /tmp/testfile.txt

but it just reads the file path, not the contents of the document

Re: espeak

Posted: Sun Mar 23, 2014 2:39 pm
by Hove

Code: Select all

cat /tmp/testfile.txt | espeak
works for me

Re: espeak

Posted: Sun Mar 23, 2014 8:08 pm
by stujol
is this code with cron or python?

Re: espeak

Posted: Sun Mar 23, 2014 8:28 pm
by wimble
stujol wrote:Can espeak read a text document?

I've tried espeak /tmp/testfile.txt

but it just reads the file path, not the contents of the document
From the espeak Usage page:
To use at the command line, type:
espeak "This is a test"
or
espeak -f <text file>

Or just type
espeak
followed by text on subsequent lines. Each line is spoken when RETURN is pressed.
So you've managed to invoke the first option, and it's speaking the name of the file :) Either insert the -f flag before the file name (thus, the second option), or use espeak as a plain command (the third option), and feed the data into it, as Hove is suggesting.

All of these are shell commands (which is what cron commands are written in, although cron isn't a requirement for them), not python.