Festival is a multi-lingual speech synthesis system. It was originally developed by Alan Black at the Centre for Speech Technology Research at the University of Edinburgh and additional contributions have been made by Garnegie Mellon University.
It sports a text to speech API, among others, and a command interface for extensions. The system supports English (both Brithsh and American) as well as Welsh and Spanish. You can also find packages for Finnish, Polish and Russian to name a few. And if that wasn't enough the whole lot of it is published under the BSD license - meaning it's free and open source.
To get started we'll need a few packages: Obviously first we'll need festival and xsel.
cat << eof > talk.sh
xsel | festival --tts --pipe
cmod +x ~/tts.sh
Next bind mod4+z to ~/talk.sh. From Ubuntu key bindings are found under System, Preferences, Keyboard Shortcuts
If you run into the error Linux: can't open /dev/dsp
(Parameter.set 'Audio_Command "aplay -q -c 1 -t raw -f s16 -r $SR $FILE")
(Parameter.set 'Audio_Method 'Audio_Command)
" >> ~/.festivalrc
The speech rate can be configured in /usr/share/festival/voices/english/kal_diphone/festvox/kal_diphone.scm
under the setting "Parameter.set 'Duration_Stretch" -- the lower the value the faster the speech rate.