#pip install gtts
Import the required module for text
to speech conversion
from gtts import gTTS
The text that you want to convert to audio
mytext = 'Welcome to Immortal coders'
Language in which you want to convert
language = 'en'
Passing the text and language to the engine,
here we have marked slow=False. Which tells
the module that the converted audio should
have a high speed
myobj = gTTS(text=mytext, lang=language, slow=False)
Saving the converted audio in a mp3 file named
welcome
myobj.save("new.mp3")
On this page of the site you can watch the video online How to convert text into audio using python with a duration of hours minute second in good quality, which was uploaded by the user Deeper Coders 01 February 2020, share the link with friends and acquaintances, this video has already been watched 47 times on youtube and it was liked by 3 viewers. Enjoy your viewing!