5

Here is what i want to do:

  1. I want to put/run Orca as an idle process in background after booting into Ubuntu. (No problem there so far.)

  2. Now when I open up a text file or website in my [web]browser; I want to be able, to highlight text and use a keyboard-shortcut in order to invoke Orca process [see step 1], to read the selected text back to me.

My problem is, that Orca, once initialized as a running process permanently reads back everything, from mouse-over actions of buttons, to system related actions etc.. and orca-preferences doesn't come with options, to reduce and suppress this. Orca might not be the right application at all for this and a common speech-synthesis application might be even better.

  • If someone knows how to make it work that way, please help.
  • An alternative speech-synthesis "read back" option/function, like Apple offers in OS X would even be better, since there one can simply "selected text", that is invoked with Ctrl+# shortcut, or simply use say, or for text files say -f ~/input.txt -o ~/output.aiff-command to have text red back instantly!

3 Answers 3

3

I found the answer here, in this comment, which does the trick in combination with festival:
(Although, these "free" speech synthesis are not even close to be as good as they ought to be!!)


wizo chocs says: March 2, 2012 at 12:49 pm

create this script xtalk

#!/bin/bash
xsel | festival --tts --pipe
  • set it executable chmod 755 xtalk
  • create a new custom keyboard shortcut, any key combo, i use ALT+X and the prog to run is your xtalk script
  • select the text u want read press ALT+X
2
  • This is working so far. But needs xsel to be installed in order to work. Don't forget the double dash on the festival parameters. Oct 7, 2017 at 19:43
  • I found that xsel needs the option -o, otherwise it just hangs
    – myQwil
    Sep 4, 2020 at 6:27
1

Would Festival do what you want? http://www.ghacks.net/2010/10/09/linux-text-to-speech-with-festival/

You also have http://clickspeak.clcworld.net/index.html or http://www.firevox.clcworld.net/installation_linux.html wich is a plugin for firefox

1
  • +1 for the links and thank you. The first link is interesting, yet i prefer the key-shortcut option to activate text to speech, rather than bash.
    – v2r
    Mar 13, 2012 at 10:25
1

Based on v2r's answer I made this script:

#!/bin/bash

ID=$(pgrep -x "espeak")
if $ID >/dev/null 2>&1
  then
    xsel | espeak -vmb-en1
  else
    kill $ID
fi

This script will stop reading when you push the key combo a second time while it is reading.

I installed

 espeak
 espeak-ng-espeak
 xsel
 mbrola 

and the some mbrola voices :

mbrola-de1
mbrola-de2
mbrola-de3
mbrola-de4
mbrola-de5
mbrola-de6
mbrola-de7
mbrola-en1
mbrola-sw1
mbrola-sw2
mbrola-us1
mbrola-us2
mbrola-us3

I made a separate script and key combo for every language. like Pause for English and Shift + Pause for German.

I use Ubuntu 18.04

For Firefox I would recommend the Talkie extension. It reads very fine and automatically detects languages.

1
  • Great! Thank you - definitely give it a go later.
    – v2r
    Oct 24, 2019 at 9:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .