python gtts 1

python gtts

>>> from gtts import gTTS
>>> tts = gTTS('hello')
>>> tts.save('hello.mp3')

Here is what the above code is Doing:
1. Importing the gTTS module for text to speech conversion
2. Passing the text ‘hello’ to the gTTS module
3. Saving the resultant audio to a file hello.mp3

Similar Posts