When I used Mac, I set up a keyboard shortcut to play highlighted text, great for listing to an article while I do something else. I doubt that feature is available in stock Fedora but wondered if anyone knows of a way to set that up somehow?
thanks
Did you search for 'text to speech on fedora`?
This is the very first link I found and there are many others related.
I’ve never used it, but it looks like Orca has a “Speak current selection” option:
Excerpted from Orca – commands_reading
Text Attributes and Selected Text
Orca has a dedicated command for obtaining the attributes of the text at the caret location. In addition, if you use Orca’s Where Am I commands from within a text object in which text has been selected, Orca will announce the selected text. Orca’s command to speak the current selection will also perform this function in a text object.Present the text attributes: Orca Modifier+F
Perform basic Where Am I:
Desktop: KP Enter
Laptop: Orca Modifier+Return
Perform detailed Where Am I:
Desktop: KP Enter (double-clicked)
Laptop: Orca Modifier+Return (double-clicked)
Speak current selection: Orca Modifier+Shift+Up
Search where on Fedora?
Going to take me a while to learn what Orca is, which appears to suggest I start by reading all about Gnome first, I will need time for that!
Just wondered if there was a simply utility hidden away I don’t know about (as was the case on Mac for years until I heard about it, and it was there all along!)
thanks
Yes, Orca does a great deal more than just reading screen text and it might be more than what you are looking for and it might depend on GNOME.
espeak
is probably one of the simplest text-to-speech tools available on Fedora Linux. You can install it with dnf install espeak
. To operate it, you “pipe” text into it. For example, try echo 'hello world' | espeak
. If you want to send highlighted text to it, you will need another small utility program to retrieve the currently-highlighted text. That program is called xclip
and you can install it with dnf install xclip
. You can test xclip
by highlighting some text somewhere and then running xclip -o
. Finally, you can combine the two by running xclip -o | espeak
and whatever text you have highlighted should be read aloud. If you bind a hotkey to the xclip -o | espeak
command, you should get a very simple version of what you have asked for. How to bind hotkeys varies depending on the desktop environment you are running. For example, I am running Sway and I can bind the Super+Control+z
hotkey to run the xclip -o | espeak
command by adding the following line to ~/.config/sway/config
and pressing Super+Shift+c
to reload my Sway configuration.
bindsym $mod+Control+z exec xclip -o | espeak
Bit scary/complex but in lieu of any other options I will make a note to check back here and see if I can learn that way. thanks