How to get speech output from entered text by using command-line?
Also facility to change speech rate, pitch, volume etc using simple command.
How to get speech output from entered text by using command-line?
Also facility to change speech rate, pitch, volume etc using simple command.
In order of descending popularity:
say converts text to audible speech using the GNUstep speech engine.
festival General multi-lingual speech synthesis system.
spd-say sends text-to-speech output request to speech-dispatcher
espeak is a multi-lingual software speech synthesizer.
espeak
is a nice little tool.I just like playing around with it in a command line. You might find it conflicts with Pulseaudio so I'm using a long-winded version that negates having to set it up properly.
espeak --help
will show you the options to calibrate reading speed, pitch, voice, etc.When you're doing your notes, save them as a text file and then:
You can then play around with ffmeg et al to compress this down from PCM to something more manageable like MP3 or OGG. But that's a different story.
From
man spd-say
:Hence you can get text-to-speech by following command:
Ex:
You can also set speech rate, pitch, volume etc. see man-page.
Python Google Speech :
Svox From Android :
Svox Nanotts :
Linked resource: Comparison of speech synthesizers
Post source: Linuxhacks.org
Disclosure: I am the owner of Linuxhacks.org
Mbrola doesn't work since 11.10.
SVOX (pico) tools are easy to install, easy to use and brings good quality voices in Ubuntu. Install it:
Even more easy, you can use LibreOffice in combination with SVOX (pico) tools by install the "Read Text" extension and you obtain a "GUI" for this excellent TTS software:
Set up Read Text Extension's options with Tools - Add-ons - Read selection.... Use /usr/bin/python as the external program. Select a command line option that includes the token (PICO_READ_TEXT_PY).
SVOX pico2wave
That's what I use. And it sounds natural, it's easy to understand and it recognizes units (m, °C,kg, ...).
Here is my first post about pico2wave.
All you have to do is: Go to Ubuntu Software Center and search for "pico". You'll find 4 or 5 entries with "Small Footprint Ling...". Install them.
A possible use of pico2wave is described in my first posting (follow the link above).
And yet another espeak gui:
gespeaker
. It uses bothespeak
andmbrola
engines. Also, it has more options thanespeak-gui
.The following is not a FLOSS solution, but you may find it worthwhile. (it is a wine solution),
I'm personally very keen on TTS, I use it quite often... eg. listening to a rambling discourse which I would never bother to stick with otherise (because I need to get another cup of coffee... :)
A few things I've discovered along the way.. or should I say, things I haven't discovered along the way... To put it bluntly: Every piece of FOSS TTS voice software I've tried is under par and therefore unsuitable for any semi-protracted listening...
I currently use ATnT's NaturalVoices. It is only available for Windows (maybe the Mac), but it does run under
wine
in Ubuntu .. (it has minor glytch, where I sometimes need to click on the panel when I move away from the reader... It is a minor issue when compared to the advantage gained by quality of speech from NatualVoices.Some other things I've found to be virtually essential for a half-sensible listening experience, are;...
These TTS progamas are not intelligent (well maybe as intelligent as a young baboon) .. so they need every bit of help they can get. and there is one (and only one Reader program I've found which helps greatly in this.. The app is called
ReadPlease (2003 Pro)
... It allowd you to specially modify words and groups of word to be pronounced as you want them... It is by no means perfect, but for me, it made the difference between the entire process being usable and not usable...The speech in Natural Voices is "okay", but it is a bit boring. There are other good products too, but they are all for Windows, unfortunately)..
It infeclts surprisingl well sometimes .. but OMG, initially it is a pain! .. so #2 is *patience... and lots of updating of your "special words" list ... By patience, I mean you(I) actually became accustomed to my particular baboon's speech patterns :)... and by the way, I currently have about 3000 words that now sound "Human" enough that I no longer cringe when I hear them.
3.. "Follow the Bouncing Ball" ... Again because the voice is never as good as a real speaker, things sometimes need to be clarified .. . The Reader program I use has one feature for which I even put up with its clunky looking interface.... Is has a "select the currently being read" word option.. Many readers have this, but ReadPlease keeps the current line bang on center of the screen .. This is invaluable to be able to see ahead and behind to quickly re-read what you just missed (so auto-centering the curent line is good)...
Well that's my experience.. I'm going to make a coffee now, and while I'm doing it, I'll be listening to this, to see how it "reads".... TTS is surprisingl good for picking up typos (I make lots of typos)...
If something as good as ATnT NaturalVoices turns up on the Ubuntu repository, I'll jump at it.
Here is a link to some samples of Natural Voices: I use "MIke"
For
festival
(the voice seems more natural to me):Pitch and speed configuration:
create
~/.festivalrc
with the following content:See also http://www.solomonson.com/content/ubuntu-linux-text-speech
Update: tried on another Ubuntu computer. Had to install English speech engine package to work with festival properly:
Also
play
is a cli command which comes with thesox
package:Even though you've already accepted an answer, I wanted to mention
festival
, which I like quite a lot too. This post on the Ubuntu forums has a lot of information on getting very nice voices set up for it.