Skip to content

Instantly share code, notes, and snippets.

@andrewn
Last active February 13, 2018 13:46
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Pi text-to-speech (TTS)

speechd is a wrapper around tts systems festival is the thing that speaks

sudo apt-get install speech-dispatcher festival -y

See which voices are available:

spd-say --list-synthesis-voices

Say something:

spd-say "I am a computer"

Say something in a scottish accent:

spd-say --synthesis-voice en-scottish "I am scottish"

Chromium should use speechd when the --enable-speech-dispatcher flag is used. But it doesn't :-(

If it did work then you should be able to get the list of voices via JS:

speechSynthesis.getVoices()

And speaking like:

speechSynthesis.speak(new SpeechSynthesisUtterance('Am I webscale?'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment