stujol
Posts: 25
Joined: Sat Mar 08, 2014 10:56 pm

espeak

Sun Mar 23, 2014 2:25 pm

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

User avatar
Hove
Posts: 1205
Joined: Sun Oct 21, 2012 6:55 pm
Location: Cotswolds, UK
Contact: Website

Re: espeak

Sun Mar 23, 2014 2:39 pm

Code: Select all

cat /tmp/testfile.txt | espeak
works for me
www.pistuffing.co.uk - Raspberry Pi and other stuffing!

stujol
Posts: 25
Joined: Sat Mar 08, 2014 10:56 pm

Re: espeak

Sun Mar 23, 2014 8:08 pm

is this code with cron or python?

wimble
Posts: 34
Joined: Tue Feb 05, 2013 9:52 am

Re: espeak

Sun Mar 23, 2014 8:28 pm

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.

Return to “Beginners”