Raspberry Pi‎ > ‎

Text to Speech for Raspberry Pi

posted Oct 25, 2015, 5:48 AM by Chris G   [ updated Oct 26, 2015, 2:13 AM ]

Google has some excellent voices in the translation API, but they do not seem to like anyone using their TTS solution in an automated way and will keep blocking your access if they suspect that you are doing so. Even adding an API key to the request will not help.


As an alternative, IVONA has some really good sounding voices that appear very natural.




You can use the Speech Cloud for development purposes for free for up to 50,000 units/month per development account. A unit consists of 200 characters (including spaces) that make up the text  ignoring SSML metadata. 


Once you sign-up for an account, using the API is actually very easy using the Python library.


sudo pip install pyvona

This is a sample script you can use to make your Pi speak:


import pyvona

awsAccessKey=
awsSecretKey=


def speak(text):
        text = text.strip()
        if len(text) == 0:
                return
	voice = pyvona.create_voice(awsAccessKey, awsSecretKey)
	voice.voice_name = "Salli"
	voice.speak(text)

speak("Hello World")

To list available voices and languages:


import pyvona

awsAccessKey=
awsSecretKey=

voice = pyvona.create_voice(awsAccessKey, awsSecretKey)
print(voice.list_voices())


To save speech as a MP3 file for re-use:

import pyvona

awsAccessKey=
awsSecretKey=


def speak(text, fileName):
        text = text.strip()
        if len(text) == 0:
                return
	voice = pyvona.create_voice(awsAccessKey, awsSecretKey)
        voice.voice_name = "Salli"
        voice.codec = 'mp3'
        voice.fetch_voice(text,fileName)


speak("Hello","hello")



IVONA also supports t



IVONA also supports the use of tags to help the TTS engine better pronounce certain expressions such as abbreviations. See the documentation for additional details: