[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[pygtk] Pygtk does not play nicely with speech-dispatcher
From: |
John Finlay |
Subject: |
[pygtk] Pygtk does not play nicely with speech-dispatcher |
Date: |
Fri, 25 Apr 2008 10:44:44 -0700 |
James Simmons wrote:
> Michael,
>
> Thanks for the tip! It was a big help. I put gtk.gdk.threads_init()
> in the __init__ method of my program and I did get callbacks. It
> looks like I didn't get callbacks for every word, but Pygtk seems to
> not be the problem anymore. Thanks again,
The problem is that gtk and by extension pygtk has an event loop, and
the python speechd api has implemented its own event loop within a
thread. The speechd protocol is synchronous and sounds similar to RPCs.
This event loop conflict was in general a problem with RPC programming
with GUIs. The best solution is to integrate the two event loops using
io_add_watch but that would entail throwing away the python speechd api
and you would not have to use threads. This is the course I would take
if I was doing your project.
If you want to use the speechd python api you have to make your pygtk
program threaded and that is more than just calling threads_init. Others
on this list can point you to a list of best practices for threading in
pygtk.
John
- Problems with "end" callback in Python, (continued)
- Problems with "end" callback in Python, Lukas Loehrer, 2008/04/20
- Problems with "end" callback in Python, Hynek Hanke, 2008/04/21
- Problems with "end" callback in Python, James Simmons, 2008/04/22
- Problems with "end" callback in Python, Hynek Hanke, 2008/04/23
- Pygtk does not play nicely with speech-dispatcher, James Simmons, 2008/04/24
- [pygtk] Pygtk does not play nicely with speech-dispatcher, Dave Aitel, 2008/04/24
- [pygtk] Pygtk does not play nicely with speech-dispatcher, James Simmons, 2008/04/24
- [pygtk] Pygtk does not play nicely with speech-dispatcher, Michael Urman, 2008/04/24
- [pygtk] Pygtk does not play nicely with speech-dispatcher, James Simmons, 2008/04/25
- [pygtk] Pygtk does not play nicely with speech-dispatcher, Dave Aitel, 2008/04/25
- [pygtk] Pygtk does not play nicely with speech-dispatcher,
John Finlay <=
- [pygtk] Pygtk does not play nicely with speech-dispatcher, Hynek Hanke, 2008/04/28
- [pygtk] Pygtk does not play nicely with speech-dispatcher, Hemant Goyal, 2008/04/28