How to make everything on stdout be read aloud (using eSpeak)?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to make everything on stdout be read aloud (using eSpeak)?
I've got the eSpeak TTS system up and running, and I like it quite a bit.
I'm wondering, is there a way to pipe EVERYTHING that gets printed to STDOUT to espeak? I'm trying to set up a system without a monitor that would speak the terminal output to me.
I've found the brltty-espeak package, but I have no idea how to set it up.
I do not know this eSpeak system, but I know every terminal has its own stdout and probably you do not really need all the stdouts, just some specific one. The normal approach is to attach TTS to a given terminal.
Based on the documentation you need to redirect stdout to espeak
Okay then, how do I redirect stdout to espeak? It seems to take normal pipe input like any other program, but how do I direct all of stdout on a terminal to espeak?
Is there a way to pipe every command to espeak without having to manually type it each time? My goal is to have a computer without a monitor which will read everything on stdout to me.
yes, there is a way (several ways). Actually I have no espeak, so I cannot test it, but in general it should work:
Code:
#you can create a fifo
ESPEAK_FIFO=/tmp/espeak_fifo
mkfifo $ESPEAK_FIFO
# start espeak in the background
espeak -f $ESPEAK_FIFO &
# or use tee to keep text on display too
cat $ESPEAK_FIFO | tee /dev/tty | espeak
# redirect stdout to fifo
exec >$ESPEAK_FIFO
this small script should be sourced in your terminal and afterwards everything displayed will be sent to espeak.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.