ESpeak: Difference between revisions

Florian (talk | contribs)
Format tweaks
Eben (talk | contribs)
 
(3 intermediate revisions by 2 users not shown)
Line 33: Line 33:


[[Category:TTS]]
[[Category:TTS]]
[[Category:Project]]
<references />
== '''KDE & gnome integration (eSpeak-NG)''' ==
This setup will let you read text with eSpeak-NG from '''any application''' on your system simply by pressing a keyboard command.
After installing eSpeak-ng on your system adding this line to a custom keyboard shortcut in KDE or Gnome.
<code>xsel > /tmp/speak.txt | espeak-ng -f "/tmp/speak.txt" | pkill xsel</code>
Type <code>man espeak-ng</code> in your terminal to see a list of options for this speech engine.
To stop espeak-ng we can use the following command:
<code>pkill espeak-ng</code>
'''Important:''' as these commands are run as a scrip instead of in a full shell environment its best to put the full path to each application you call, for example: usr/bin/xsel & usr/bin/espeak-ng etc.
In gnome open system settings then go to: Keyboard » Customise Shortcuts » Custom Shortcuts » + and make two new shortcuts, one to start reading using the line above and another shortcut to stop reading with the <code>pkill espeak-ng</code> command.
In KDE open system settings then go to: Shortcuts » Custom Shortcuts and make to new shortcuts one to start reading using the line above and another shortcut to stop reading with the <code>pkill espeak-ng</code> command.
Create a file for xsel to store the text you want to read. In this example this file is in the /tmp directory and is called speak.txt (but you can use a different file name and directory if you like).
'''What do these commands and switch’s do:'''
<code>xsel > my_file_name.txt</code> (over rights the text in the file with highlighted text)
<code>espeak-ng -f</code> (calls the espeak-ng tts engine to start reading a file inside the "")
<code>pkill xsel</code> (stops the computer starting a new process for xsel every time this command is run).
<code>pkill espeak-ng</code> (stops espeak-ng).