I am trying into convert text to speech in Python using the gTTS module. Is there a method you can use which does not involve saving the audio to an mp3 file and instead plays the it directly? I have looked online for a while but I still can't find a method which completely avoids saving to files. Thanks!
Try using pyttsx3. Usage:
import pyttsx3
engine = pyttsx3.init()
engine.say("I will speak this text")
engine.runAndWait()
This does not save audio to an mp3 file and works offline.
Link to source code
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With