There are numerous benefits of this technique if you have large text data and you don’t want to read them all, even there are many people who would prefer listening to podcasts and audiobooks as their way of consuming information, especially while they are traveling.
There are several APIs available to convert text to speech in python. One of such APIs is the Google Text to Speech API commonly known as the gTTS API. gTTS is a very easy to use tool which converts the text entered, into audio which can be saved as an mp3 /wav file.
To install gTTS library run below code, this command automatically downloads and installs the library
pip install gTTS
pip install os
in this step, we will import important libraries that we will be using throughout this tutorial.
import os
from gtts import gTTS
#text #audio #data-science #nlp #data-analysis