1from gtts import gTTS
2
3# ask for text to speak
4text = input("enter text to speak: ")
5
6# generate tts
7output = gTTS(text=text, lang="en", tld="co.in")
8output.save(f"tts.mp3")
9
1The best library because you dont have to save the
2text file or open the file to start the speech
3
4pip install pyttsx3
5
6import pyttsx3
7engine = pyttsx3.init()
8engine.say("Hello world")
9engine.runAndWait()