You probably now that Stephen Hawking (never got a Nobel Price) was on BigBang A LOT.

And he writes to speech synthesis and eye-tracker.

And he is giving hilarious funny interviews with this thing DECtalk DTC01…

While also saying that AI could go wrong. If AI becomes self-improving – it could outsmart us all.

also it takes some time to get used to… but then you probably get 90% of the text it reads, like this NASA news article about water and lake on mars in English:

or this science article about a lake on mars in German:

here it is:

Oh fuck – it is running Windows 7. hate the autocomplete on my android phone. it sucks. Well whatever.

so what you will need to output your own text to speech?

not much.

#apt based
apt install xsel espeak festival

#rpm based
yum install xsel espeak festival

xsel takes text from your clipboard and puts it into a bash variable that can then be passed to espeak (src) to speak it.

the user can test the text to voice programs like this:

# use english and low pitch voice
espeak -ven-us -p0 "hello world";

# use german and low pitch voice
espeak -vde -p0 "hallo welt";

# you can output to file.wav
espeak -ven-us -p0 "hello world" -w hello_world.wav

here comes a little espeak demo:

it almost sounds like Hawking 🙂

which one is better?

while festival has the better (more hakwing like) voice it does not handle special chars very well and does not pause after a dot. (why? oh? why?)

use it to read from text file

example: copy & paste text from webbrowser into a file.txt and then send it to:

# read in english (-ven)
cat ./path/to/file.txt | espeak -ven -p30

# read in german (-vde)
cat ./path/to/file.txt | espeak -vde -p30

use it to read the clipboard:

(did not work for Debian 10)

# create a new script
touch /bin/talk.sh
chmod +x /bin/talk.sh
vim /bin/talk.sh
# fill with:
#!/bin/bash

# also toutput text to screen
xsel;
text=$(xsel);

if [[ $1 = "de" ]]
then
	espeak -vde -p30 "$text";
else
	xsel | festival --tts --pipe
fi

now the user can mark any text on your webbrowser (under mate + lightdm that is enough to get it into clipboard) but you might need to r-click it -> copy or middle-mouse button.

then go to terminal and just type talk.sh (for english) or talk.sh de (for german) and it should display and read the clipboard text.

while espeak can imitate a lot of languages “by default”, for festival you will need tts files, i could not find any except for english.

… espeak does not seem to be able to speak chinese or japanese.

espeak --voices
Pty Language Age/Gender VoiceName          File          Other Languages
 5  af             M  afrikaans            other/af      
 5  an             M  aragonese            europe/an     
 5  bg             -  bulgarian            europe/bg     
 5  bs             M  bosnian              europe/bs     
 5  ca             M  catalan              europe/ca     
 5  cs             M  czech                europe/cs     
 5  cy             M  welsh                europe/cy     
 5  da             M  danish               europe/da     
 5  de             M  german               de            
 5  el             M  greek                europe/el     
 5  en             M  default              default       
 2  en-gb          M  english              _en           (en-uk 2)(en 2)
 2  en-gb          M  english              en            (en-uk 2)(en 2)
 5  en-sc          M  en-scottish          other/en-sc   (en 4)
 5  en-uk-north    M  english-north        other/en-n    (en-uk 3)(en 5)
 5  en-uk-rp       M  english_rp           other/en-rp   (en-uk 4)(en 5)
 5  en-uk-wmids    M  english_wmids        other/en-wm   (en-uk 9)(en 9)
 2  en-us          M  english-us           en-us         (en-r 5)(en 3)
 5  en-wi          M  en-westindies        other/en-wi   (en-uk 4)(en 10)
 5  eo             M  esperanto            other/eo      
 5  es             M  spanish              europe/es     
 5  es-la          M  spanish-latin-am     es-la         (es-mx 6)(es 6)
 5  et             -  estonian             europe/et     
 5  fa             -  Farsi                asia/fa       
 5  fa-pin         -  Farsi-Pinglish       asia/fa-pin   
 5  fi             M  finnish              europe/fi     
 5  fr-be          M  french-Belgium       europe/fr-be  (fr 8)
 5  fr-fr          M  french               fr            (fr 5)
 5  ga             -  irish-gaeilge        europe/ga     
 5  grc            M  greek-ancient        other/grc     
 5  hi             M  hindi                asia/hi       
 5  hr             M  croatian             europe/hr     (hbs 5)
 5  hu             M  hungarian            europe/hu     
 5  hy             M  armenian             asia/hy       
 5  hy-west        M  armenian-west        asia/hy-west  (hy 8)
 5  id             M  indonesian           asia/id       
 5  is             M  icelandic            europe/is     
 5  it             M  italian              europe/it     
 5  jbo            -  lojban               other/jbo     
 5  ka             -  georgian             asia/ka       
 5  kn             -  kannada              asia/kn       
 5  ku             M  kurdish              asia/ku       
 5  la             M  latin                other/la      
 5  lt             M  lithuanian           europe/lt     
 5  lv             M  latvian              europe/lv     
 5  mk             M  macedonian           europe/mk     
 5  ml             M  malayalam            asia/ml       
 5  ms             M  malay                asia/ms       
 5  ne             M  nepali               asia/ne       
 5  nl             M  dutch                europe/nl     
 5  no             M  norwegian            europe/no     (nb 5)
 5  pa             -  punjabi              asia/pa       
 5  pl             M  polish               europe/pl     
 5  pt-br          M  brazil               pt            (pt 5)
 5  pt-pt          M  portugal             europe/pt-pt  (pt 6)
 5  ro             M  romanian             europe/ro     
 5  ru             M  russian              europe/ru     
 5  sk             M  slovak               europe/sk     
 5  sq             M  albanian             europe/sq     
 5  sr             M  serbian              europe/sr     
 5  sv             M  swedish              europe/sv     
 5  sw             M  swahili-test         other/sw      
 5  ta             M  tamil                asia/ta       
 5  tr             M  turkish              asia/tr       
 5  vi             M  vietnam              asia/vi       
 5  vi-hue         M  vietnam_hue          asia/vi-hue   
 5  vi-sgn         M  vietnam_sgn          asia/vi-sgn   
 5  zh             M  Mandarin             asia/zh       
 5  zh-yue         M  cantonese            asia/zh-yue   (yue 5)(zhy 5)

manpages:

festival.man.txt

espeak.man.txt

xsel.man.txt

links:

http://festvox.org/voicedemos.html

liked this article?

  • only together we can create a truly free world
  • plz support dwaves to keep it up & running!
  • (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
  • really really hate advertisement
  • contribute: whenever a solution was found, blog about it for others to find!
  • talk about, recommend & link to this blog and articles
  • thanks to all who contribute!
admin