Text to speech (TTS) is the conversion of written text into spoken voice.You can create TTS programs in golang. The quality of the spoken voice depends on your speech engine.
In this article you’ll learn how to create your own TTS program.
Related course: Introducing Go: Build Reliable, Scalable Programs
The program ‘espeak’ is a simple speech synthesizer which converst written text into spoken voice. The espeak program does sound a bit robotic, but its simple enough to build a basic program.
Google speech synthesizes technology can also be used for text to speech programs. The example program below will convert text to speech using a Google API. You will need mplayer installed;
# needs mplayer installed
This will output spoken voice / an mp3 file.