How do i do text to speech translations in python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How do i do text to speech translations in python

I want allow a user to input something and then whatever he inputs i change it to speech. I can only seem to do that with already written text not users input

18th Aug 2020, 9:14 AM
Gigi Aislin
Gigi Aislin - avatar
5 Answers
+ 1
This is a very basic example to convert a user input to speech. import pyttsx3 text = input('Text to speech: ') engine = pyttsx3.init() engine.say(text) engine.runAndWait()
18th Aug 2020, 9:46 AM
Gabriele
Gabriele - avatar
+ 1
The problem was my code editor. I was using sublime text 3.I switched back to python IDE and it worked. Thanks
19th Aug 2020, 10:33 AM
Gigi Aislin
Gigi Aislin - avatar
0
I tried this it doesn't work for me
18th Aug 2020, 10:09 AM
Gigi Aislin
Gigi Aislin - avatar
0
Where do you get the error?
18th Aug 2020, 10:31 AM
Gabriele
Gabriele - avatar
0
After inputing the text the compiler just runs for a while and stops. No sound is played
18th Aug 2020, 11:41 AM
Gigi Aislin
Gigi Aislin - avatar