I basically want a logging system with text to speech in python but i am afraid it will pause the main program. Following program is working for me but it will pause thread where ever i log text to speech. Is there any way in python where i can log but it should not block main program.
import pyttsx3
class TextToSpeech:
def textToSpeech(self, text):
engine = pyttsx3.init()
engine.say(text)
engine.runAndWait()
t2s = TextToSpeech()
t2s.textToSpeech("Hello")
t2s.textToSpeech("How are you")
t2s.textToSpeech("I am fine")