Python Forum
Know when the pyttsx3 engine stops talking - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Know when the pyttsx3 engine stops talking (/thread-34756.html)



Know when the pyttsx3 engine stops talking - UsualCoder - Aug-29-2021

So I am having this issue, I recently discovered the pyttsx3 API and the documentation isn't really helping, the "isBusy" function doesn't seem to work very well, apparently it doesn't tell when the engine stops "talking". Does anyone have more experience with this API and can help me? Thank you.


RE: Know when the pyttsx3 engine stops talking - Larz60+ - Aug-29-2021

You can ask the author (Nathan M Bhat) email here: [email protected]


RE: Know when the pyttsx3 engine stops talking - UsualCoder - Aug-29-2021

(Aug-29-2021, 07:25 PM)Larz60+ Wrote: You can ask the author (Nathan M Bhat) email here: [email protected]

Thank you for the information!


RE: Know when the pyttsx3 engine stops talking - snippsat - Aug-29-2021

If i test so do engine work as long the text given to it are,
if look at processes used so are there two these get shut down/cleaned when no more text.
Tell more what you have problem with.
Here code i did test with in a virtual environment.
import pyttsx3

engine = pyttsx3.init()
engine.say("I will speak this text" * 10)
print(engine.isBusy())
engine.runAndWait()

#--------------

import pyttsx3
import time

engine = pyttsx3.init()
words = ["here","are","some","test","words"]
engine.startLoop(False)
for w in words:
    time.sleep(1)
    engine.say(w)
    engine.iterate()
    print(w)
    while engine.isBusy(): # wait until finished talking
        time.sleep(.1)
engine.endLoop()