Text to Speech using gTTS module in Python | Google Text-to-speech

Опубликовано: 07 Октябрь 2024
на канале: Rishabh Narayan
12,818
119

#gTTS #Python #TextToSpeech

Hello guys,
In this video, I am going to show that how you can get Text-to-speech output in Python using gTTS module of python ( Google Text-to-speech ). gTTS module will convert your text into speech and generate a .mp3 audio file inside the directory you are working. For installing the module use 'pip install gTTS' command in your Windows PowerShell or Command Prompt.
The code which I'll be using in the above video is :

from gtts import gTTS

def textToAudio(str):
audio = gTTS(str)
audio.save('filename.mp3')
textToAudio('enter the text here')

Editor Used : Visual Studio Code
Download Visual Studio Code : https://code.visualstudio.com/

Installation Tutorial ( Visual Studio Code ) : https://www.youtube.com/watch?v=L967c...

Follow me on Instagram (@ri5h46h) :   / ri5h46h  

Follow me on Twitter (@explorishabh) :   / explorishabh