#Import the required module for text
#to speech conversion
from gtts import gTTS
#This module is imported so that we can
#play the converted audio
import os
#The text that you want to convert to audio
mytext='There is nothing either good or bad, but thinking makes it so.'
#Language in which you want to convert
language='en'
#Passing the text and language to the engine,
#here we have marked slow=False.Whichtells
#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("texttospeech.mp3")
#Playing the converted file
os.system("mpg321 texttospeech.mp3")
Text to speech using python
Subscribe to:
Post Comments (Atom)
-
Puzzle - There are 3 temples and 3 rivers. The river and the temple are alternatively. Like - River Temple River Temple River Temple ...
-
Information technology is growing very fast in India. Bangalore, Chennai, Hyderabad, Pune and Noida are now IT hub of India. Every day man...
-
I want to share one puzzle which was asked to me in one technical interview. Puzzle - One camel owner want to transport 3000 Bananas to...
-
#Import the required module for text #to speech conversion from gtts import gTTS #This module is imported so that we can #play the converted...
ReplyDeleteThis is really a good source of information, I will often follow it to know more information and expand my knowledge, I think everyone should know it, thanks
Best ccnp service provider.
Are you looking for the best Quantum Computing Training in Noida to gain a competitive edge in this transformative field? Look no further than APTRON! Our comprehensive Quantum Computing Training program in Noida is your gateway to unlocking the potential of quantum technology.
ReplyDelete