> ## Content Index
> Fetch the complete content index at: https://ebenfarnworth.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Text to speech (TTS) on Linux
- URL: https://ebenfarnworth.com/text-speech-tts-linux/
- Published: 2021-10-01T05:58:46.000Z
- Updated: 2026-10-30T05:00:40.000Z
- Description: TTS Text to speech on Linux Arch, Ubuntu, GNOME KDE Make Linux TTS work like it does on a Mac. This is my latest attempt at switching from OSX to Linux. TTS is the final part of the puzzle for me to make this work. I'm dyslexic and rely heavily on TTS for my daily computing usage.
- Author: Eben Farnworth

## TTS Text to speech on Linux Arch, Ubuntu, GNOME KDE

#### Arch, Ubuntu, CentOS; KDE & GNOME

#### The journey so far

My new post about A.I. voices can be found [here](https://ebenfarnworth.com/text-to-speech-on-linux-ai-rising/).  
  
I have wanted to switch all my computer use over to Linux for many years. When I first tried Linux in 2011 I started going through all the software use cases I had and ticking them off, but I could not find any text to speech software that worked in a way I wanted, however even back then I found workable solutions for everything else. I started off as many people did with Ubuntu and used that on and off on old computers until 2018\. I used CentOS on my web server from 2015 and continue to this day (I will switch this out for Rocky Linux at some point in the future).

Here is my first ever post on TTS from 2013, written when I was trying seriously for the first time to switch my main computer over to Linux: [https://ubuntuforums.org](https://ubuntuforums.org/showthread.php?t=2111436&ref=ebenfarnworth.com). Long story short, I failed and carried on using OSX. Since then, every few years I have returned to this issue doing online research to see if I can find new information on suitable text to speech options. Everything else I need is already built for Linux, but this still remains a bit of an issue for me, due to the way I use TTS.

Why I use text to speech. My English ability is very poor (dyslexia), I have a reading and spelling age in English of a 12-year-old child. Everything I write and much of what I read I use my computer to read back. I use the built-in function in OSX that lets me assign a keyboard command to do TTS, which for me is the command + 3 key on my keyboard to read back any text in any application using the computer's inbuilt TTS voices (this is available from System Settings » Accessibility » Speech in OSX).

![Mac TTS setup screenshot](https://ebenfarnworth.com/content/images/2026/10/mac_tts.png)

For me to pick up mistakes in my writing, I need the voice to read clearly (not natural sounding) but clear pronunciation and I need to access this voice in any application that uses text across my computer, it needs to also speak quickly and load fast.

In 2013 I tried out some Linux TTS, it only worked in the command line, and I had no idea at the time how to pipe text from the application I was using to that voice in a usable way. I also found that the voices were slower and the pronunciation was not good enough to pick up mistakes in my writing. Some people suggested using online TTS services and that seems to be the preferred method for TTS now, not just in Linux but all over as you can get a better more natural sounding voice built with machine learning and running on a very powerful system. However, this is also not what I want, I want to work off-line sometimes and I don’t like the idea of sending everything I read and write to someone else’s computer (the cloud) for analysis.

In 2019 I started playing around with Arch and Arch distros of Linux. I found some software called [Light Read](https://github.com/lex148/LightRead?ref=ebenfarnworth.com) that solved the command line to keyboard shortcut integration function and integrated it with Festival TTS. It's a program written in Go that makes Festival read things from anywhere on your system (only for Arch Linux). I to this day have not been able to get Light Read to work. It's old software that has had no updates for years. I also started to learn a little Python coding and have been using Linux for my server for a long time and feeling more confident on trying to get the integration working myself.

Now I’m writing this as much for myself as anyone else as I work towards getting a usable TTS for Linux so I can finally ditch my dependence on OSX and have this document to reference whenever I need to install a new system.

Arch has, I think, some of the best documentation in the Linux world and their list of [TTS software](https://wiki.archlinux.org/title/List%5Fof%5Fapplications?ref=ebenfarnworth.com#Speech%5Fsynthesizers) for Linux is the biggest I have found. Currently I’m using Arch as my preferred distro with the KDE desktop environment. I not only like the documentation that Arch has, I also like that there is no company behind it, it's maintained by a community. It’s also super fast even on old hardware.

The current speech engines I’m working with to see if I can get a working solution are:  
**Mimic, Festival, eSpeak NG and Swift**; there are many others too, have a look at [this list](https://wiki.archlinux.org/title/List%5Fof%5Fapplications?ref=ebenfarnworth.com#Speech%5Fsynthesizers) to see more TTS systems.

---

# 

# My solutions for this in KDE and GNOME

The below two examples use a TTS engine and `xsel` which can take any highlighted text on your system and pipe that text into files and applications.

**KDE example: Adding a bash command to a custom keyboard shortcut**  
The first image shows a command that copies highlighted text to a file and then uses Festival TTS to speak the words from that file. The file is overwritten every time the command is executed. The second command stops the TTS engine (sometimes you start the TTS on something and wish to stop it).

![KDE custom shortcuts screenshot](https://ebenfarnworth.com/content/images/2026/10/KDE-custom-shortcuts.png)

![KDE custom keyboard shortcuts second image screenshot](https://ebenfarnworth.com/content/images/2026/10/KDE-custom-shortcuts-2.png)

**GNOME example: Adding a bash command to a custom keyboard shortcut**  
Open system settings then go to: Keyboard » Customise Shortcuts » Custom Shortcuts » +:

![GNOME custom keyboard shortcuts screenshot](https://ebenfarnworth.com/content/images/2026/10/gnome-custom-shortcuts.png)

To get your own working TTS system with this setup, copy and modify the commands you want to use from the below examples into the custom key shortcuts and make sure you have the software you need for them installed. Then assign a keyboard shortcut to run the script.

---

# Installing software

Most Linux distros now have nice GUI software centres to install a wide range of software, different distros have different package management and syntax for interacting with them.

Debian and Ubuntu install software like this:

```
sudo apt install espeak-ng
```

Red Hat, CentOS, Rocky Linux, etc install like this:

```
sudo yum install espeak-ng
```

Arch based distros install like this:

```
sudo pacman -S espeak-ng
```

(where espeak-ng is the name of the package you want to install).

---

# Implementation

The rest of this article will show working examples using Mimic, Festival, eSpeak NG and Cepstral Swift. For my use case I would rank the TTS engines I tried like this:

1. Mimic (with the slt voice)
2. Festival (with the default voice)
3. Cepstral (with the Millie voice)
4. eSpeak NG (all voices sound bad)

---

### **Updates to this article based on my real world use of this system will be added below**

I’m not experienced at writing bash scripts! I now know an easier way to do some of the below examples. We need to use the full path for every program we want to call in the script instead of the terminal shorthand:

`/usr/bin/xsel | /usr/bin/festival -tts | /usr/bin/pkill xsel`

This means we can pipe text straight into festival without first copying it to a text file.

To find out the full path to any program you want to call, use the `which` command.

```
which festival
```

Prints: /usr/bin/festival

---

Depending on the speed of your system you may need to add a delay between copying the text to the file and starting speaking. We can do this by using the ‘sleep’ command, for my system a delay of 0.3 seconds worked fine:

`xsel > /tmp/speak.txt | sleep 0.3 | mimic -f /tmp/speak.txt | pkill xsel`

If you often read long texts or if you're running this on a low-power computer like a Raspberry Pi then you may need a longer delay.

---

# Mimic

The setup that worked and lets me use TTS in KDE like I do in OSX by adding this line to a custom keyboard shortcut in KDE or GNOME.

`xsel > /tmp/speak.txt | sleep 0.3 | mimic -f /tmp/speak.txt | pkill xsel`

I further optimised this by adding some configuration options that change the pitch and speed of the voice:

`xsel > /tmp/speak.txt | mimic -voice slt --setf duration_stretch=0.85 --setf int_f0_target_mean=165 -f /tmp/speak.txt | pkill xsel`

Stop mimic with:

```
pkill mimic
```

**What do these commands and switches do:**

`xsel > my_file_name.txt` (overwrites the text in the file with highlighted text)

`mimic` (calls the mimic TTS engine to start speaking)

`-voice slt` (sets the voice to the slt voice)  
`--setf duration_stretch=0.75` (makes it speak 25% faster (1 = normal speed and 1.5 is 50% slower)).

`--setf int_f0_target_mean=200` (makes the pitch higher and =1 would make the pitch very low).

`-f` (means read text from file)

`pkill xsel` (stops the computer starting a new process for xsel every time this command is run).

There are quite a few voices installed with Mimic, the voice slt was my favourite. Type: `mimic -lv` in terminal to see a list of installed voices. Type: `man mimic` to see all the options and switches.

Mimic is built on [Flite TTS](https://github.com/festvox/flite?ref=ebenfarnworth.com) and the commands are the same as far as I can see.

---

# Festival

Similar to Mimic, use this line to make Festival speak text from a custom command by using the following line to use festival in the default configuration. Bind a keyboard command to this command in KDE or GNOME to start Festival TTS.

`xsel > /tmp/speak.txt | festival --tts /tmp/speak.txt | pkill xsel`

Bind a second keyboard command to stop Festival. (Needed for when you want to stop reading something!)

`pkill audsp`

---

**Dependencies:**  
alsa-utils  
PulseAudio  
festival  
xsel  
git (if on Arch)

---

**Configuration**

To see what festival voices you have installed, open a terminal and type: **festival**  
then in the festival prompt, type (voice.list) to see the list of voices you have installed.

`festival > (voice.list)`

You can test out the voices by selecting one in the festival prompt, copy the voice you want to try from the above command and add ‘voice\_’ to the front of it like this:

`festival> (voice_us2_mbrola)`

Now use the ‘SayText’ command to try out the voice you selected above:

`festival> (SayText "Hello from Arch Linux")`

Once you have found a voice you like, you can set it as the default festival voice like this:

`(set! voice_default 'voice_nitech_us_rms_arctic_hts')`

Changing the speaking speed:  
edit the file of the voice you want to change the speech speed, on my system this is the file for the Kal voice:

/usr/share/festival/voices/english/kal\_diphone/festvox/kal\_diphone.scm

`sudo nano /usr/share/festival/voices/english/kal_diphone/festvox/kal_diphone.scm`

Then look for the section `‘Duration prediction’`. On my system for the kal voice this is on line: 216\. Then change the number 1.1 to a higher or lower number:

`(Parameter.set 'Duration_Stretch 1.1)`

Change it to a higher or lower number and save the file (Control+E » y » Enter). Restart festival and repeat until you have the speed you like. In the Omilo GUI (below) it's also possible to change the reading speed.

Festival can be configured by creating a `$HOME/.festivalrc` configuration file.

Festival will create an incriminating text file called **`$HOME/.festival_history`** with every command sent to it.

---

**Other voices**  
Here is an old blog post about compiling and [installing festival voices on Debian](https://teknologisuara.blogspot.com/2011/11/howto-make-festival-tts-use-better.html?ref=ebenfarnworth.com). I was not able to get any of these to work on my system and HTS voices from the [AUR](https://aur.archlinux.org/?ref=ebenfarnworth.com) would also not compile on my system either. I was able to install two ‘us\_en CMU’ voices from the AUR which worked and had really good sound **(best sounding TTS I tried on my system)**. However, they used about 800MB of RAM and took about two minutes to load 100 words and start speaking on my old Intel i3 computer. I might come back to this at some point but for now I was not able to get other voices to work (running festival version 2.5.0-4).

---

**Troubleshooting**

audio\_open\_alsa: failed to set hw parameters. Invalid argument.

If festival gives you this error you need to install the ‘alsa’ package.

---

**Omilo, a GUI for Festival**

[https://sourceforge.net/projects/o-milo/](https://sourceforge.net/projects/o-milo/?ref=ebenfarnworth.com)  
(I want TTS from a keyboard command but if you want it from a GUI then this one seems ok in KDE.) This also has one-click festival voice installation! I tried to get Omilo to work, without success. I think the reason it might not be working on my system is that it’s new and uses Wayland instead of Xorg. But I have not tried an Xorg system to see if that fixes the problem! I used it a few years ago and it worked on Elementary OS.

---

# eSpeak NG

Similar to Mimic, use this line to make eSpeak NG speak text from a custom keyboard command by using the following line in KDE or GNOME:

`xsel > /tmp/speak.txt | espeak-ng -f "/tmp/speak.txt" | pkill xsel`

Type `man espeak-ng` in your terminal to see a list of options for this speech engine.

To stop espeak-ng we can use the following command:

```
pkill espeak-ng
```

---

# Cepstral Swift

A closed source voice that works on Linux systems. Personally I don’t find their voices to be better than you can get out of Festival and Mimic.

Cepstral uses the `swift` command to read text. So to use the workflow for Swift we can do it like this:

`xsel > /tmp/speak.txt | padsp swift -f /tmp/speak.txt | pkill xsel`

To stop the swift engine use this command.

```
pkill swift.bin
```

---

**Configuration**

This uses the `-p` switch:

\- speech/rate  
 Integer  
 Speaking rate (average WPM).  
 Assume default to be 170WPM.

\- speech/pitch/shift  
 Floating point  
 Frequency multiplier to use for adjusting pitch. Default is 1.0.

Something like:

```
padsp swift -p -speech/rate 180 -f /tmp/speak.txt
```

---

**Troubleshooting**

oss\_audio: failed to open audio device /dev/dsp  
Install oss on your system  
Call: `padsp swift` instead of `swift`.

Buying the licence code requires contacting the company by phone or email! In the past you could just buy it from the website.

---

# Other software explored during research

---

# Speech-dispatcher

*“Speech-dispatcher is a system daemon that allows programs to use one of the installed speech synthesizer programs to produce audio from text input as long as it has a special module or a configuration file for the speech synthesizer programs you want to use. It sits a a layer between programs that would like to turn text into speech and programs who actually do that.”* [From here](https://linuxreviews.org/Speech-dispatcher?ref=ebenfarnworth.com)

---

**Configuration**

Speech-dispatcher can be configured using the configuration file **/etc/speech-dispatcher/speechd.conf** and "module" specific configuration files in **/etc/speech-dispatcher/modules/**.

**Usage**

```
spd-say “hello from Arch”
```

Unfortunately the spd-say command does not seem to be able to read text from a file. I can’t think of a way currently to make Speech Dispatcher work in the same way as I’m doing using Mimic directly above.

To use xsel as we did with Mimic above to speak the text selected using the Speech Dispatcher, the command is short and simple.

```
xsel | spd-say -e | pkill xsel
```

However, this does not work when placed in a bash script (running outside of the terminal) or into the custom command field in KDE/GNOME. I have yet to find a working solution using Speech Dispatcher. Do leave a comment if you know how to make this work.

I also tried this too:

`xsel > /tmp/speak.txt && cat /tmp/speak.txt | spd-say -e | pkill xsel`

Works in the terminal but not when called from KDE.

---

**Troubleshooting**

```
spd-say
```

Error: setlocale: No such file or directory  
Fix: [https://github.com/mobile-shell/mosh/issues/144](https://github.com/mobile-shell/mosh/issues/144?ref=ebenfarnworth.com)  
fix: `export LANG='en_US.UTF-8'`

In some systems there is a different package called speech-dispatcher-utils that also needs to be installed but in Arch currently speech-dispatcher-utils is part of the speech-dispatcher package.

Testing

```
sudo systemctl status speech-dispatcherd.service
```

---

# AT&T TTS

[https://wizzardsoftware.com/](https://wizzardsoftware.com/?ref=ebenfarnworth.com)

High quality voices that are likely very expensive! You can try a demo on their website, I think these are the best quality client-side voices I have heard.

I expect after looking at their [Linux documentation](https://wizzardsoftware.com/documentation/Developer's%20Guide%20for%20Linux.pdf?ref=ebenfarnworth.com), it would be quite easy to get the same setup for an AT&T voice as I have demonstrated with the above using Mimic, etc and xsel to read text from anywhere on the system.

---

# Links:

Arch - list of TTS software: [https://wiki.archlinux.org/title/List\_of\_applications#Speech\_synthesizers](https://wiki.archlinux.org/title/List%5Fof%5Fapplications?ref=ebenfarnworth.com#Speech%5Fsynthesizers)

Arch wiki festival: [https://wiki.archlinux.org/title/Festival](https://wiki.archlinux.org/title/Festival?ref=ebenfarnworth.com)

Festival website with voice demo: [https://www.cstr.ed.ac.uk/projects/festival/morevoices.html](https://www.cstr.ed.ac.uk/projects/festival/morevoices.html?ref=ebenfarnworth.com)

Festival code: [https://github.com/festvox/festival](https://github.com/festvox/festival?ref=ebenfarnworth.com)

Festival Manual (For festival 1.4.0): [https://www.cstr.ed.ac.uk/projects/festival/manual/](https://www.cstr.ed.ac.uk/projects/festival/manual/?ref=ebenfarnworth.com)

TTS compare: [https://linuxreviews.org/Text\_to\_Speech\_synthesis\_software](https://linuxreviews.org/Text%5Fto%5FSpeech%5Fsynthesis%5Fsoftware?ref=ebenfarnworth.com)

About festival: [https://linuxreviews.org/Festival](https://linuxreviews.org/Festival?ref=ebenfarnworth.com)

Make festival use better voices: [https://teknologisuara.blogspot.com/2011/11/howto-make-festival-tts-use-better.html](https://teknologisuara.blogspot.com/2011/11/howto-make-festival-tts-use-better.html?ref=ebenfarnworth.com) & [https://ubuntuforums.org/showthread.php?t=751169&page=12](https://ubuntuforums.org/showthread.php?t=751169&page=12&ref=ebenfarnworth.com)

Festival voice demo: [http://festvox.org/voicedemos.html](http://festvox.org/voicedemos.html?ref=ebenfarnworth.com)

Festival voice download: [http://hts.sp.nitech.ac.jp/?Download#w6dddb75](http://hts.sp.nitech.ac.jp/?Download&ref=ebenfarnworth.com#w6dddb75)

Mycroft tts engine options: [https://mycroft-ai.gitbook.io/docs/using-mycroft-ai/customizations/tts-engine](https://mycroft-ai.gitbook.io/docs/using-mycroft-ai/customizations/tts-engine?ref=ebenfarnworth.com)

Flite useful to understand mimic better: [https://github.com/festvox/flite](https://github.com/festvox/flite?ref=ebenfarnworth.com)

Changing reading speed in festival: [https://festival-talk.festvox.narkive.com/RUAJ5rAQ/how-to-make-text2wave-speak-faster](https://festival-talk.festvox.narkive.com/RUAJ5rAQ/how-to-make-text2wave-speak-faster?ref=ebenfarnworth.com)

xsel usage: [https://www.techrepublic.com/blog/linux-and-open-source/use-xsel-to-copy-text-between-cli-and-gui/](https://www.techrepublic.com/blog/linux-and-open-source/use-xsel-to-copy-text-between-cli-and-gui/?ref=ebenfarnworth.com)

I'm going to end this here and make updates to this if I find out anything new. I may at any time move this information to another platform. Anyone can use or reuse this information. If you maintain a wiki page or provide documentation for any open-source projects and this was useful, feel free to copy this into your own documentation.  
I added a second post about this looking at A.I. voices, you can read it [here](https://ebenfarnworth.com/text-to-speech-on-linux-ai-rising/).