Hi all,
I have been looking for ways to improve the espeak user experience including modifying/adding new voices and came across this article regarding Gespeaker which is a graphical interface for espeak. It's easier to use especially for bits of text which you can cut and paste from a webpage and have read. To expand the text window to accommodate large chunks of texts click on the "advanced settings" button (see image).
There is an option for variant in the voice section (where you have male and female - which work). I don't know how to make use of this to add a variant (of a voice?). I will update this if I find a way.
To install Gespeaker, open Terminal and
$ sudo apt-get install gespeaker
You also need to install python-dbus
$ sudo apt-get install python-dbus
for the application to run.
Update.
I managed to add additional mbrola voices that can be used with Gespeaker.
This how. First install the mbrola text-to-speech engine.
Open Terminal and enter
$ sudo apt install mbrola
followed by pressing the return key.
You should see something this if the install ran okay
"MBROLA 3.01h - speech synthesizer
Author : Thierry Dutoit with help of AC/DC adaptator Vincent Pagel
Copyright (c) 95 Faculte Polytechnique de Mons (TCTS lab) - T.Dutoit...etc"
To keep it simple, we'll paste our config at the top of speechd.conf and comment-out one setting in speechd.conf.
So open speechd.conf:
sudo nano /etc/speech-dispatcher/speechd.conf
Paste the following at the top of the document:
# Enable British English "en1"
AddModule "espeak-mbrola-generic" "sd_generic" "espeak-mbrola-generic.conf"
DefaultModule espeak-mbrola-generic
LanguageDefaultModule "en1" "espeak-mbrola-generic"
Now search using "Ctrl+W" and copy/paste:
DefaultModule espeak-ng
Now comment it out by adding a hash at the beginning, like this:
#DefaultModule espeak-ng
Now save speechd.conf in nano:
Press Ctrl+X
Press "Y" to overwrite
Press Enter to save and close nano
Start the speech-dispatcher daemon
Start the daemon paste in the command:
sudo speech-dispatcher -d
This should start the speech daemon.
Testing mbrola? I don't know how.
Testing the new British English voice in espeak will not produce your changes; it will be the default espeak voice, not the "en1", British English voice you're now using for mbrola.
I don't know how to test mbrola, so I will just continue on with my implementation of mobrola-en1.
Speak Text for Okular
If you're interested in using a PDF Reader that has a "text to speech" feature, install Okular:
sudo apt install okular
Now, open a PDF and:
Press "Ctrl+3" to set tool to "Area Selection"
Click & drag a box over a section of text you want Okular to read
After the context menu appears, select "Speak Text"
Success!
You've now successfully setup text to speech, using speech-dispatcher, espeak, mbrola, and mbrola-en1 using Okular through the Ubuntu Package Repository.
Adjust the speed of reading
By default, mbrola-en1 reads rather quickly. To "slow down" the speed, espeak--mbrola-generic config.
Copy text to run in terminal line by line:
Download: http://www.tcts.fpms.ac.be/synthesis/mbrola/dba/en1/en1-980910.zip
Copy text to run in terminal line by line:
Now run espeak, with options
Nice, but it seems he is reading too fast, try:
you can install embrola voices executing the following command:
for more information visit the offical repo from github
espeak docs and man pages
Here is a copy of Mateo's answer as a single command and cleanup.
You will need
sudo
privileges to copy to/usr/bin/
.I am getting this error when text is read but it seems to work:
If anyone knows what is causing this error please let me know in the comments.
Gespeaker on Ubuntu 18.04
Hi all, I have been looking for ways to improve the espeak user experience including modifying/adding new voices and came across this article regarding Gespeaker which is a graphical interface for espeak. It's easier to use especially for bits of text which you can cut and paste from a webpage and have read. To expand the text window to accommodate large chunks of texts click on the "advanced settings" button (see image).
There is an option for variant in the voice section (where you have male and female - which work). I don't know how to make use of this to add a variant (of a voice?). I will update this if I find a way.
To install Gespeaker, open Terminal and
$ sudo apt-get install gespeaker
You also need to install python-dbus
$ sudo apt-get install python-dbus
for the application to run.
Update. I managed to add additional mbrola voices that can be used with Gespeaker.
This how. First install the mbrola text-to-speech engine. Open Terminal and enter $ sudo apt install mbrola followed by pressing the return key.
You should see something this if the install ran okay "MBROLA 3.01h - speech synthesizer Author : Thierry Dutoit with help of AC/DC adaptator Vincent Pagel Copyright (c) 95 Faculte Polytechnique de Mons (TCTS lab) - T.Dutoit...etc"
Next install a mbrola voice. You can view a list of available voice packages here: http://www.muflone.com/gespeaker/english/mbrola_voices/ubuntu1610 The last updates were for Ubuntu 16.10. I haven't found newer versions.
Install a voice package.For example to install the US english female voice run
$ sudo apt install mbrola-us1
Restart Gespeaker.
You should see the voice appear amongst the existing espeak voices in the language bar of Gespeaker. See the image below.
I still don't know how to employ the "Variant" option.
Credits: https://vitux.com/convert-text-to-voice-with-espeak-on-ubuntu/
This process works on 20.04.2 LTS (Focal Fossa):
Find your voice
Find the desired mbrola voice by visiting the github:
https://github.com/numediart/MBROLA-voices
Locate and document the desired voice. For this example, I'm going to use British English, which is "en1".
Get dependencies
Install the dependent applicatons:
Edit speech-dispatcher/speechd.conf
To keep it simple, we'll paste our config at the top of speechd.conf and comment-out one setting in speechd.conf.
So open speechd.conf:
Paste the following at the top of the document:
Now search using "Ctrl+W" and copy/paste:
Now comment it out by adding a hash at the beginning, like this:
Now save speechd.conf in nano:
Start the speech-dispatcher daemon
Start the daemon paste in the command:
This should start the speech daemon.
Testing mbrola? I don't know how.
Testing the new British English voice in espeak will not produce your changes; it will be the default espeak voice, not the "en1", British English voice you're now using for mbrola.
I don't know how to test mbrola, so I will just continue on with my implementation of mobrola-en1.
Speak Text for Okular
If you're interested in using a PDF Reader that has a "text to speech" feature, install Okular:
Now, open a PDF and:
Success!
You've now successfully setup text to speech, using speech-dispatcher, espeak, mbrola, and mbrola-en1 using Okular through the Ubuntu Package Repository.
Adjust the speed of reading
By default, mbrola-en1 reads rather quickly. To "slow down" the speed, espeak--mbrola-generic config.
With the config open in nano,
Set GenericRateAdd to a number between 80 and 320
Adjust pitch
Below GenericRateAdd, you can also adjust Pitch:
Now save espeak-mbrola-generic.conf in nano:
Adjust the word gap speed
espeak provides an easy way to adjust the time between words that text is read. To adjust said gap, open your module config file:
One of the first uncommented lines looks like this:
Add in an argument after espeak, "-g 15" to set the word gap time to 15ms (default is 10ms):
If you saved a bad config...
Skip this if you've saved & successfully run a good speechd config.
If you manage to screw up and save your config file, refer to Jeremy Bicha's response.
First remove the speechd.conf
Reinstall speech-dispatcher and regenerate config