Text to speech is a process to convert any text into voice. Different API’s are available in Python in order to convert text to speech. One of such API’s is the Google Text to Speech commonly known as the gTTS API. It is very easy to use the library which converts the text entered, into an audio file which can be saved as a mp3 file. It supports several languages and the speech can be delivered in any one of the two available audio speeds, fast or slow.
To install the required libraries, you can pip install command. Then import all libraries.
- tkinter
- gTTS
- pygame
I used the popular tkinter library for rendering graphics on a display window, gTTs (google text to speech) library to convert text to voice, and pygame library to play that converter voice from the text.