speechd-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problems with "end" callback in Python


From: Hemant Goyal
Subject: Problems with "end" callback in Python
Date: Fri, 18 Apr 2008 19:09:29 +0530

Hi,

I think INDEX_MARK could be used to mark off positions in your text to
indicate to speech-dispatcher when to return to the callbacks.

I read about that in the python api documentation :

 INDEX_MARK = 'index_marks'
    """Index mark events are reported when the place they were
    included into the text by the client application is reached
    when speaking them"""

On the flip side, I think your text buffer might become overfilled with
these index markers, and you will also have to neglect them when you re
printing the text on screen.

Best,
Hemant

On Fri, Apr 18, 2008 at 1:43 AM, James Simmons <jim.simmons at walgreens.com>
wrote:

> Hynek,
>
> I have been looking for an alternative to using gobject.timeout_add() in
> my program and hit on the idea of trying threads in Python.  I found out
> that pygtk is not thread safe, hence you need to use gtk.threads_enter() and
> gtk.threads_leave() before and after you execute any GTK code from another
> thread.  It sounds like thread support in a pygtk application is
> problematic.  It would help if I could avoid it.
>
> What would make my life simpler would be a way to invoke speech dispatcher
> on a word and have the function not return until the word has finished being
> spoken.  That way I would not have to deal with callbacks and multiple
> threads.  Another thing that might work is invoking speech dispatcher on an
> entire page and having a callback called at the end of each word.  That way
> the calbacks could drive the highlighting of the words, rather than having
> the logic that highlights the words drive the speaking.  That might actually
> give more natural sounding results, and would eliminate the need for
> gobject.timeout_add().
>
> If you have any thoughts on this I'd like to hear them.
>
> James Simmons
>
>
> Hynek Hanke wrote:
>
>
> > Hello James,
> >
> > I have tried to run the code you've sent and I can reliably reproduce
> > the issue. I believe it has something to do with the way how you call
> > speechd.client.speak() from inside the gtk loop, because outside of it,
> > everything works normally (even in your application).
> >
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
http://lists.freebsoft.org/pipermail/speechd/attachments/20080418/181b7216/attachment.htm
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]