Conversion of Text to Speech:

We have many APIs in Python for Data Science, which is capable of converting text to speech. One such API is the Google text to speech API, which is commonly known as gTTS API. It is a very easy and useful tool and converts the text to audio which can also be saved as an mp3 file.

The gTTS API supports several languages which include English, German, Tamil, Hindi, French, and many other languages. The speech can be deliver into any of the two audio speed options, i.e., fast and slow. But it is not possible to change the voice of the generate audio.

Installation:

For installation of gTTS API, we will open the terminal ad write:

pip install gTTS

It will work on any platform. Now we will write a sample program for the conversion of text to speech.

Conversion of Text to Speech in Python for Data Science - PST Analytics

So, to learn more about it in python for data science, you can check this and this as well.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.