<div dir="ltr"><div><div>James,<br><br></div>I've made the changes. It works on the latest Fedora. Accelerator for Stop button is fixed.<br><br></div>James Simmons<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 25, 2016 at 5:30 PM, James Simmons <span dir="ltr"><<a href="mailto:nicestep@gmail.com" target="_blank">nicestep@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">James,<div><br></div><div>At the moment the highlighting code doesn't work that well. What it does is to insert tags into your text, then create a list of tuples containing start and end positions of the words in the text area. The gstreamer code gives me the sequence number of each word, I look up the tuple and highlight the word. The highlighting skips over words or lags behind much of the time. Not really robust enough to share with anyone at this point.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>James Simmons</div></font></span><div><div class="h5"><div><br><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 25, 2016 at 3:01 PM, James Cameron <span dir="ltr"><<a href="mailto:quozl@laptop.org" target="_blank">quozl@laptop.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks.<br>
<br>
How practical is it to add a word highlight callback to the sugar3<br>
speech module? It might be useful for other activities.<br>
<span><br>
On Mon, Jan 25, 2016 at 11:29:39AM -0600, James Simmons wrote:<br>
> James,<br>
><br>
</span><span>> I'll have a look at the accelerator.<br>
><br>
> My code needs its own speech function because I highlight each word as it is<br>
> being spoken. That function never worked that well, but I'd like to keep it.<br>
> Read ETexts is the first application to use the gstreamer espeak plugin. I'll<br>
> need to update the MYOSA TTS chapter to include the speech module.<br>
><br>
> I had no idea that everyone moved from Gitorious to GitHib. The MYOSA book<br>
> describes using GitHub, so it looks like I'll need to move all my code and<br>
> rewrite that chapter. I won't be able to do either one for awhile, but I'll get<br>
</span>> to it. In the interim I'll put the new entry in [1]<a href="http://activity.info" rel="noreferrer" target="_blank">activity.info</a>.<br>
<span>><br>
> Read ETexts has a collaboration feature (file transfer, not Tubes). I haven't<br>
> had the opportunity to check that yet. Hopefully it still works.<br>
><br>
> This Activity is an old one, from the days when a Kindle was more expensive<br>
> than an XO and Project Gutenberg did not have much support for PDF (the only<br>
> format the Read Activity could use at the time). I had a lot more time to work<br>
> on Sugar code and documentation back then. I don't remember how.<br>
><br>
> James Simmons<br>
><br>
</span><span>> On Sun, Jan 24, 2016 at 9:06 PM, James Cameron <[2]<a href="mailto:quozl@laptop.org" target="_blank">quozl@laptop.org</a>> wrote:<br>
><br>
> G'day James,<br>
><br>
> Line 476 of your ReadEtextsActivity.py changes the accelerator for the<br>
> stop button to '<Ctrl><Shift>Q', but the default in Sugar is<br>
> '<Ctrl>Q', and the only activities that ought not use the default are<br>
> those where ctrl-q has special meaning, such as Terminal.<br>
><br>
> References:<br>
><br>
</span>> [3]<a href="https://wiki.sugarlabs.org/go/Hotkeys" rel="noreferrer" target="_blank">https://wiki.sugarlabs.org/go/Hotkeys</a><br>
> [4]<a href="https://github.com/sugarlabs/sugar-toolkit-gtk3/blob/master/src/sugar3/" rel="noreferrer" target="_blank">https://github.com/sugarlabs/sugar-toolkit-gtk3/blob/master/src/sugar3/</a><br>
<span>> activity/widgets.py#L87<br>
><br>
> For speech, is there any reason you can't use the speech module in the<br>
> sugar-toolkit-gtk3 package?<br>
><br>
</span>> [5]<a href="https://github.com/sugarlabs/sugar-toolkit-gtk3/blob/master/src/sugar3/" rel="noreferrer" target="_blank">https://github.com/sugarlabs/sugar-toolkit-gtk3/blob/master/src/sugar3/</a><br>
<span>> speech.py<br>
><br>
> Thanks for the gitorious pointer, I wasn't aware which source control<br>
> repository you were using. Everybody else has moved to GitHub, but nobody<br>
> has taken down Sugar Labs gitorious yet, perhaps there are others like<br>
> you still using it.<br>
><br>
</span>> Your activity/[6]<a href="http://activity.info" rel="noreferrer" target="_blank">activity.info</a> file can have a new field for that;<br>
<span>><br>
> repository = <URL><br>
><br>
> On Sun, Jan 24, 2016 at 08:11:39PM -0600, James Simmons wrote:<br>
> > James,<br>
> ><br>
> > I tested on Fedora 23 Workstation. The speech feature works OK there. I<br>
> don't<br>
> > think I'm doing anything with Ctrl-q.<br>
> ><br>
> > This is the code that I think is being complained about when it disables<br>
> > speech:<br>
> ><br>
</span>> > [1][7]<a href="http://git.sugarlabs.org/readetexts/mainline/blobs/master/speech.py" rel="noreferrer" target="_blank">http://git.sugarlabs.org/readetexts/mainline/blobs/master/speech.py</a><br>
<span>> ><br>
> > The line is:<br>
> ><br>
> > Gst.ElementFactory.make('espeak')<br>
> ><br>
> > I see similar lines elsewhere where a second argument is used, specifying<br>
> > source or sink.<br>
> ><br>
> > I'll give this another try later, probably tomorrow evening. Don't<br>
> release this<br>
> > version.<br>
> ><br>
> > I could use some clarification on what ctrl-q is supposed to do. I<br>
> haven't done<br>
> > Sugar coding for something like three years and this sounds new.<br>
> ><br>
> > James Simmons<br>
> ><br>
</span>> > On Sun, Jan 24, 2016 at 6:18 PM, James Cameron <[2][8]<a href="mailto:quozl@laptop.org" target="_blank">quozl@laptop.org</a>><br>
<span>> wrote:<br>
> ><br>
> > On Sun, Jan 24, 2016 at 04:28:50PM -0500, Sugar Labs Activities<br>
> wrote:<br>
</span>> > > [3][9]<a href="http://activities.sugarlabs.org/downloads/file/29159/" rel="noreferrer" target="_blank">http://activities.sugarlabs.org/downloads/file/29159/</a><br>
<span>> read_etexts-27.xo<br>
> ><br>
> > Tested briefly on Fedora 20.<br>
> ><br>
> > 1. the ctrl-q short cut does not work, an older ctrl-shift-q does,<br>
> ><br>
> > 2. no speech feature seen,<br>
> ><br>
> > 3. functional test passed, downloaded Emma by Jane Austen,<br>
> ><br>
</span>> > Logs: [4][10]<a href="http://dev.laptop.org/~quozl/z/1aNUoS.txt" rel="noreferrer" target="_blank">http://dev.laptop.org/~quozl/z/1aNUoS.txt</a><br>
> ><br>
> > --<br>
> > James Cameron<br>
> > [5][11]<a href="http://quozl.netrek.org/" rel="noreferrer" target="_blank">http://quozl.netrek.org/</a><br>
> > _______________________________________________<br>
> > Sugar-devel mailing list<br>
> > [6][12]<a href="mailto:Sugar-devel@lists.sugarlabs.org" target="_blank">Sugar-devel@lists.sugarlabs.org</a><br>
> > [7][13]<a href="http://lists.sugarlabs.org/listinfo/sugar-devel" rel="noreferrer" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
> ><br>
> > References:<br>
> ><br>
> > [1] [14]<a href="http://git.sugarlabs.org/readetexts/mainline/blobs/master/" rel="noreferrer" target="_blank">http://git.sugarlabs.org/readetexts/mainline/blobs/master/</a><br>
> speech.py<br>
> > [2] mailto:[15]<a href="mailto:quozl@laptop.org" target="_blank">quozl@laptop.org</a><br>
> > [3] [16]<a href="http://activities.sugarlabs.org/downloads/file/29159/" rel="noreferrer" target="_blank">http://activities.sugarlabs.org/downloads/file/29159/</a><br>
> read_etexts-27.xo<br>
> > [4] [17]<a href="http://dev.laptop.org/~quozl/z/1aNUoS.txt" rel="noreferrer" target="_blank">http://dev.laptop.org/~quozl/z/1aNUoS.txt</a><br>
> > [5] [18]<a href="http://quozl.netrek.org/" rel="noreferrer" target="_blank">http://quozl.netrek.org/</a><br>
> > [6] mailto:[19]<a href="mailto:Sugar-devel@lists.sugarlabs.org" target="_blank">Sugar-devel@lists.sugarlabs.org</a><br>
> > [7] [20]<a href="http://lists.sugarlabs.org/listinfo/sugar-devel" rel="noreferrer" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
><br>
> --<br>
> James Cameron<br>
> [21]<a href="http://quozl.netrek.org/" rel="noreferrer" target="_blank">http://quozl.netrek.org/</a><br>
><br>
> References:<br>
><br>
> [1] <a href="http://activity.info/" rel="noreferrer" target="_blank">http://activity.info/</a><br>
> [2] mailto:<a href="mailto:quozl@laptop.org" target="_blank">quozl@laptop.org</a><br>
> [3] <a href="https://wiki.sugarlabs.org/go/Hotkeys" rel="noreferrer" target="_blank">https://wiki.sugarlabs.org/go/Hotkeys</a><br>
> [4] <a href="https://github.com/sugarlabs/sugar-toolkit-gtk3/blob/master/src/sugar3/activity/widgets.py#L87" rel="noreferrer" target="_blank">https://github.com/sugarlabs/sugar-toolkit-gtk3/blob/master/src/sugar3/activity/widgets.py#L87</a><br>
> [5] <a href="https://github.com/sugarlabs/sugar-toolkit-gtk3/blob/master/src/sugar3/speech.py" rel="noreferrer" target="_blank">https://github.com/sugarlabs/sugar-toolkit-gtk3/blob/master/src/sugar3/speech.py</a><br>
> [6] <a href="http://activity.info/" rel="noreferrer" target="_blank">http://activity.info/</a><br>
> [7] <a href="http://git.sugarlabs.org/readetexts/mainline/blobs/master/speech.py" rel="noreferrer" target="_blank">http://git.sugarlabs.org/readetexts/mainline/blobs/master/speech.py</a><br>
> [8] mailto:<a href="mailto:quozl@laptop.org" target="_blank">quozl@laptop.org</a><br>
> [9] <a href="http://activities.sugarlabs.org/downloads/file/29159/read_etexts-27.xo" rel="noreferrer" target="_blank">http://activities.sugarlabs.org/downloads/file/29159/read_etexts-27.xo</a><br>
> [10] <a href="http://dev.laptop.org/~quozl/z/1aNUoS.txt" rel="noreferrer" target="_blank">http://dev.laptop.org/~quozl/z/1aNUoS.txt</a><br>
> [11] <a href="http://quozl.netrek.org/" rel="noreferrer" target="_blank">http://quozl.netrek.org/</a><br>
> [12] mailto:<a href="mailto:Sugar-devel@lists.sugarlabs.org" target="_blank">Sugar-devel@lists.sugarlabs.org</a><br>
> [13] <a href="http://lists.sugarlabs.org/listinfo/sugar-devel" rel="noreferrer" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
> [14] <a href="http://git.sugarlabs.org/readetexts/mainline/blobs/master/speech.py" rel="noreferrer" target="_blank">http://git.sugarlabs.org/readetexts/mainline/blobs/master/speech.py</a><br>
> [15] mailto:<a href="mailto:quozl@laptop.org" target="_blank">quozl@laptop.org</a><br>
> [16] <a href="http://activities.sugarlabs.org/downloads/file/29159/read_etexts-27.xo" rel="noreferrer" target="_blank">http://activities.sugarlabs.org/downloads/file/29159/read_etexts-27.xo</a><br>
> [17] <a href="http://dev.laptop.org/~quozl/z/1aNUoS.txt" rel="noreferrer" target="_blank">http://dev.laptop.org/~quozl/z/1aNUoS.txt</a><br>
> [18] <a href="http://quozl.netrek.org/" rel="noreferrer" target="_blank">http://quozl.netrek.org/</a><br>
> [19] mailto:<a href="mailto:Sugar-devel@lists.sugarlabs.org" target="_blank">Sugar-devel@lists.sugarlabs.org</a><br>
> [20] <a href="http://lists.sugarlabs.org/listinfo/sugar-devel" rel="noreferrer" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
> [21] <a href="http://quozl.netrek.org/" rel="noreferrer" target="_blank">http://quozl.netrek.org/</a><br>
<br>
> _______________________________________________<br>
> Sugar-devel mailing list<br>
> <a href="mailto:Sugar-devel@lists.sugarlabs.org" target="_blank">Sugar-devel@lists.sugarlabs.org</a><br>
<div><div>> <a href="http://lists.sugarlabs.org/listinfo/sugar-devel" rel="noreferrer" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
<br>
<br>
--<br>
James Cameron<br>
<a href="http://quozl.netrek.org/" rel="noreferrer" target="_blank">http://quozl.netrek.org/</a><br>
</div></div></blockquote></div><br></div></div></div></div></div>
</blockquote></div><br></div>