I want to make python read string which added in a variable from before because I am creating scraping script and if there are any errors, I want it to tell me, I watched many of video about that but all were about read the text and then creating mp3 file, not to read the string in the same time
Asked
Active
Viewed 809 times
2 Answers
-1
i found a selution
import playsound
from gtts import gTTS
def speak(text):
tts= gTTS(text= text, lang="en")
# filename="voice.mp3"
tts.save(filename)
playsound.playsound(filename)
speak("error")

Eslam Tantawy
- 115
- 8