-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixed issue where NSApp terminate called after endLoop #226
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a novice, but making these changes worked for me. My simple app had a tkinter window and button. Press the button and the app listens for a prompt. Depending upon the prompt it either says hello, goodbye or get the current weather and says it out loud. Before the changes, the app just quit. Now it does not and I can press the button and make another prompt.
@nateshmbhat any thoughts on this PR? Or PR#271? |
This bug is such pain in the ass, now its 2024, it's still here |
@holytony you could instead use the apple speech API using subprocess as I implemented here. Here is a simplified example:
|
this actually works. also the pyttsx3 is blocking when it speaks, during which the UI would freeze when its called, even creating a new thread would't solve the problem, however, when I call subprocess say in a new thread, it works flawlessly, thank a lot. |
The macOS driver uses PyObjC to driver the speech synthesis. In PyObjC after the event loop is stopped the app calls terminate. This remedies that by driving the runloop ourselves instead of calling AppHelper.startEventLoop. Everything else proceeds normally.