I have tried PyTTS (deprecated) and PyTTSx (the most recommended) and two Google TTS solutions (gTTS and another one by some guy named Hung Truong) but none of them worked under
I just installed gtts 1.0.7 that was uploaded on 2015-10-07
The following code works for me in Python 3.5:
import subprocess
from gtts import gTTS
audio_file = "hello.mp3"
tts = gTTS(text="Hello World!", lang="en")
tts.save(audio_file)
return_code = subprocess.call(["afplay", audio_file])
I'm on a Mac using in the inbuilt "afply" to play the mp3 but there are other ways e.g. Playing mp3 song on python