nateshmbhat / pyttsx3

Offline Text To Speech synthesis for python
Mozilla Public License 2.0
2.12k stars 333 forks source link

pyttsx3 closing some GUI interfaces prematurely #130

Open a2435191 opened 4 years ago

a2435191 commented 4 years ago

When I run pyttsx3 with, say, rumps or tkinter and use runAndWait, the GUI quits prematurely. Any idea why this might be happening/how to fix? I am running the following sample code on MacOS 10.14, Python 3.8.x.

import tkinter as tk
import pyttsx3

engine = pyttsx3.init()

def play_my_sound():
    engine.say("Hello world")
    engine.runAndWait()

window = tk.Tk()
window.after(1000, play_my_sound)
window.mainloop()
issue-label-bot[bot] commented 4 years ago

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.84. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

nateshmbhat commented 4 years ago

Try running play sound in a seperate thread.