<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>mindtrove &#187; speech</title>
	<atom:link href="http://mindtrove.info/tag/speech/feed/" rel="self" type="application/rss+xml" />
	<link>http://mindtrove.info</link>
	<description>Collecting ideas since 1980</description>
	<lastBuildDate>Thu, 01 Jul 2010 01:58:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>JSonic: Speech and sound using HTML5</title>
		<link>http://mindtrove.info/jsonic-speech-and-sound-using-html5/</link>
		<comments>http://mindtrove.info/jsonic-speech-and-sound-using-html5/#comments</comments>
		<pubDate>Tue, 11 May 2010 02:37:23 +0000</pubDate>
		<dc:creator>Peter Parente</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[dojo]]></category>
		<category><![CDATA[jsonic]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[speech]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://mindtrove.info/?p=318</guid>
		<description><![CDATA[I've released a new library called JSonic for text-to-speech synthesis and sound playback in browsers supporting HTML5 &#60;audio&#62;. The code is on GitHub along with full documentation of the JS and REST APIs. The client API is implemented as a Dojo dijit._Widget subclass. Other client implementations are possible as long as they provide the same [...]]]></description>
			<content:encoded><![CDATA[<p>I've released a new library called JSonic for text-to-speech synthesis and sound playback in browsers supporting HTML5 &lt;audio&gt;. The code is on <a href="http://github.com/parente/jsonic">GitHub</a> along with <a href="http://parente.github.com/jsonic">full documentation</a> of the JS and REST APIs.</p>
<p>The client API is implemented as a Dojo dijit._Widget subclass. Other client implementations are possible as long as they provide the same JS interface. The TTS synthesis is implemented server-side using <a href="http://espeak.sourceforge.net/">espeak</a> and <a href="http://www.tornadoweb.org/">Tornado</a>. Other server implementations are possible as long as they adhere to the REST API, and other speech engines can be plugged in rather easily.</p>
<p>The <a href="http://sites.google.com/site/uncopenweb/">UNC Open Web group</a> is looking to use JSonic to build self-voicing web games for kids with disabilities. I've already ported my <a href="http://mindtrove.info/spaceship">Spaceship!</a> game (<a href="http://github.com/parente/spaceship">also available on GitHub</a>) to use it instead of Outfox, and hope deploy it somewhere in the near future.</p>
<p>Bug reports, bug fixes, comments, questions, uses, and so on are welcome. Please use the issue tracker on the GitHub project page when reporting bugs.</p>
]]></content:encoded>
			<wfw:commentRss>http://mindtrove.info/jsonic-speech-and-sound-using-html5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML5 audio caching</title>
		<link>http://mindtrove.info/html5-audio-caching/</link>
		<comments>http://mindtrove.info/html5-audio-caching/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 00:36:11 +0000</pubDate>
		<dc:creator>Peter Parente</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[jsonic]]></category>
		<category><![CDATA[speech]]></category>

		<guid isPermaLink="false">http://mindtrove.info/?p=284</guid>
		<description><![CDATA[One of my latest coding endeavors is a text-to-speech interface for JavaScript using HTML5 &#60;audio&#62; elements to output synthesized speech from a server. To reduce the latency between a speech request and actual speech output, I'm using various levels of caching. One of these is the regular browser disk cache based on HTTP headers. It [...]]]></description>
			<content:encoded><![CDATA[<p>One of my latest coding endeavors is a <a href="http://github.com/parente/jsonic">text-to-speech interface for JavaScript</a> using HTML5 &lt;audio&gt; elements to output synthesized speech from a server. To reduce the latency between a speech request and actual speech output, I'm using various levels of caching. One of these is the regular browser disk cache based on HTTP headers.</p>
<p>It turns out that browser caching behavior for &lt;audio&gt; data varies wildly among browsers. The following table shows the HTML5 &lt;audio&gt; caching behavior of various browsers. I tested all of them on OS X 10.6 with the standard Mac Apache server hosting all of the tested audio files.</p>
<table>
<thead>
<tr>
<th>Browser</th>
<th>&lt;audio&gt; Behavior</th>
</tr>
</thead>
<tbody>
<tr>
<td>Firefox 3.6</td>
<td>Respects cache headers for the sound data. Only contacts the server when the cache item expires. &lt;audio&gt; elements pointing to the same <code>src</code> reuse the cache data.</td>
</tr>
<tr>
<td>Chrome 5.0.322.2</td>
<td>Contacts the server on every <code>load()</code>. When it receives a 304 response, does not refetch content.*</td>
</tr>
<tr>
<td>Safari 4.0.4</td>
<td>Contacts the server to fetch first two bytes of the audio file on every <code>load()</code>. Receives a 206 response with partial content. Fetches the additional bytes from the file. Receives another 206 response with the partial content. Performs another fetch and receives a 304 response with no data. Continues to alternate between fetches that receive 206 partial data responses and 304 not modified responses. Nothing appears to get cached.</td>
</tr>
<tr>
<td>Webkit r54921</td>
<td>Same behavior as Safari 4.0.4.</td>
</tr>
</tbody>
</table>
<p><span style="font-size: smaller;">* Though not cache related, audio output in Chrome is often clipped before the end of the actual audio data. When this occurs, Chrome fires the <code>onended</code> event even before the audible output finishes.</span> </p>
<p>Except for Firefox 3.6, all of these browsers seem to exhibit pretty terrible caching behavior when it comes to audio. I've reported bugs where I thought appropriate, but maybe I'm missing something. Am I supposed to include additional headers in the server-side response? Or maybe I'm glossing over some key part of the &lt;audio&gt; API? If so, please let me know. If not, yikes: &lt;audio&gt; support has definite room for improvement.</p>
]]></content:encoded>
			<wfw:commentRss>http://mindtrove.info/html5-audio-caching/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>pyttsx</title>
		<link>http://mindtrove.info/pyttsx/</link>
		<comments>http://mindtrove.info/pyttsx/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 21:45:20 +0000</pubDate>
		<dc:creator>Peter Parente</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[speech]]></category>

		<guid isPermaLink="false">http://mindtrove.info/?p=250</guid>
		<description><![CDATA[pyttsx is a cross-platform text-to-speech package for Python. It has a simple API for producing speech, setting some basic engine properties, and getting start/stop/word callbacks. pyttsx currently supports SAPI5, NSSpeechSynthesizer, and espeak, but it can be extended to support other engines and libraries. The project BSD licensed and hosted on Launchpad. PyPI tracks downloads for [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://pypi.python.org/pypi/pyttsx/1.0">pyttsx</a> is a cross-platform text-to-speech package for Python. It has a simple API for producing speech, setting some basic engine properties, and getting start/stop/word callbacks.  pyttsx currently supports SAPI5, NSSpeechSynthesizer, and espeak, but it can be extended to support other engines and libraries.</p>
<p>The project BSD licensed and hosted on <a href="https://launchpad.net/pyttsx">Launchpad</a>. PyPI tracks <a href="http://pypi.python.org/pypi/pyttsx">downloads</a> for the latest stable version and <a href="http://packages.python.org/pyttsx/">documentation</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://mindtrove.info/pyttsx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Outfox in Greasemonkey revisited</title>
		<link>http://mindtrove.info/outfox-in-greasemonkey-revisited/</link>
		<comments>http://mindtrove.info/outfox-in-greasemonkey-revisited/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 02:39:30 +0000</pubDate>
		<dc:creator>Peter Parente</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Ideas]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[greasemonkey]]></category>
		<category><![CDATA[outfox]]></category>
		<category><![CDATA[speech]]></category>

		<guid isPermaLink="false">http://mindtrove.info/?p=219</guid>
		<description><![CDATA[There was some traffic in the Outfox group about my GMail announcer userscript failing in Outfox 0.3.x. The Outfox API has improved quite a bit since 0.1.0, so it's no surprise my script no longer works. Here's a new example script that does work with the latest Outfox 0.3.5 release. Instead of polluting the example [...]]]></description>
			<content:encoded><![CDATA[<p>There was some <a href="http://groups.google.com/group/outfox-discuss/browse_thread/thread/67c53a86a8814a2a">traffic in the Outfox group</a> about my <a href="http://mindtrove.info/outfoxing-gmail-with-greasemonkey/">GMail announcer userscript</a> failing in Outfox 0.3.x. The Outfox API has improved quite a bit since 0.1.0, so it's no surprise my script no longer works.</p>
<p>Here's a new example script that <em>does</em> work with the latest Outfox 0.3.5 release. Instead of polluting the example with all the complications of navigating the GMail DOM, I've picked a much simpler target. This script simply speaks the number of major sections (level 2 headings) in a Wikipedia article when the page loads. It's not as sexy, but the code is much easier to understand.</p>
<p>To try this script, make sure you have the Greasemonkey 0.8 and Outfox 0.3.5 extensions installed on Firefox 3.0 or 3.5. Then visit the following link to have GM install the script: <a href="/files/citation_announcer.user.js">citation_announcer.user.js</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// ==UserScript==</span>
<span style="color: #006600; font-style: italic;">// @name Sections count</span>
<span style="color: #006600; font-style: italic;">// @namespace http://www.mindtrove.info/</span>
<span style="color: #006600; font-style: italic;">// @description Speaks the number of h2 sections in a Wikipedia article</span>
<span style="color: #006600; font-style: italic;">// @include http://*.wikipedia.org/wiki/*</span>
<span style="color: #006600; font-style: italic;">// @require http://www.json.org/json2.js</span>
<span style="color: #006600; font-style: italic;">// @require http://outfox.googlecode.com/svn/trunk/js/outfox.js</span>
<span style="color: #006600; font-style: italic;">// ==/UserScript==</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// number of major sections</span>
<span style="color: #003366; font-weight: bold;">var</span> sections <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> onOutfoxAudioInit<span style="color: #009900;">&#40;</span>response<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #006600; font-style: italic;">// say the number of main sections</span>
    outfox.<span style="color: #660066;">audio</span>.<span style="color: #660066;">say</span><span style="color: #009900;">&#40;</span>sections <span style="color: #339933;">+</span> <span style="color: #3366CC;">' main sections'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #006600; font-style: italic;">// return the parameter for other outfox deferred callbacks</span>
    <span style="color: #000066; font-weight: bold;">return</span> response<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> onOutfoxInit<span style="color: #009900;">&#40;</span>version<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> content <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'bodyContent'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #006600; font-style: italic;">// count the number of main sections</span>
    sections <span style="color: #339933;">=</span> content.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'h2'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>
    <span style="color: #006600; font-style: italic;">// take one back for the TOC heading if it's present</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'toc'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #339933;">--</span>sections<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #006600; font-style: italic;">// start the outfox audio service</span>
    <span style="color: #003366; font-weight: bold;">var</span> def <span style="color: #339933;">=</span> outfox.<span style="color: #660066;">startService</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'audio'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    def.<span style="color: #660066;">addCallback</span><span style="color: #009900;">&#40;</span>onOutfoxAudioInit<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #006600; font-style: italic;">// return the parameter for other outfox deferred callbacks</span>
    <span style="color: #000066; font-weight: bold;">return</span> version<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> onDOMContentLoaded<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #006600; font-style: italic;">// create a node for outfox use</span>
    <span style="color: #003366; font-weight: bold;">var</span> div <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    document.<span style="color: #660066;">body</span>.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>div<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #006600; font-style: italic;">// initialize outfox</span>
    <span style="color: #003366; font-weight: bold;">var</span> def <span style="color: #339933;">=</span> outfox.<span style="color: #660066;">init</span><span style="color: #009900;">&#40;</span>div<span style="color: #339933;">,</span> JSON.<span style="color: #660066;">stringify</span><span style="color: #339933;">,</span> JSON.<span style="color: #660066;">parse</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    def.<span style="color: #660066;">addCallback</span><span style="color: #009900;">&#40;</span>onOutfoxInit<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// this event triggers execution of the GM script</span>
onDOMContentLoaded<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://mindtrove.info/outfox-in-greasemonkey-revisited/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Outfoxing Gmail with Greasemonkey</title>
		<link>http://mindtrove.info/outfoxing-gmail-with-greasemonkey/</link>
		<comments>http://mindtrove.info/outfoxing-gmail-with-greasemonkey/#comments</comments>
		<pubDate>Wed, 30 Jul 2008 11:56:21 +0000</pubDate>
		<dc:creator>Peter Parente</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Ideas]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[outfox]]></category>
		<category><![CDATA[pgo]]></category>
		<category><![CDATA[speech]]></category>

		<guid isPermaLink="false">http://mindtrove.info/?p=97</guid>
		<description><![CDATA[NOTE: The code in this post is out-of-date and does not work with recent versions of Outfox. See http://mindtrove.info/outfox-in-greasemonkey-revisited/ for a simpler, more compatible example. If you do update the GMail announcer code so it works with Outfox again, drop me a line and I'll link to your script. Can you remember a time when [...]]]></description>
			<content:encoded><![CDATA[<p><strong>NOTE</strong>: The code in this post is out-of-date and does not work with recent versions of Outfox. See http://mindtrove.info/outfox-in-greasemonkey-revisited/ for a simpler, more compatible example. If you do update the GMail announcer code so it works with Outfox again, drop me a line and I'll link to your script.</p>
<hr />
<p>Can you remember a time when the title of this blog post might have landed me in a straight jacket? Can you believe that was just a few short years ago? Yea, I can't either.</p>
<p>Anyway, Gary's post <a href="http://wwwx.cs.unc.edu/~gb/wp/blog/2008/07/27/outfox-speech-sound-and-more-for-firefox/">Outfox: speech, sound, and more for Firefox</a> talks about a new Firefox extension. He's using it to create cross-platform, self-voicing Web apps for kids with disabilities using a pure JS API. He hopes to extend his work to support alternative input devices such as game pads and switches as the Outfox extension matures and grows more flexible.</p>
<p>One of the other potential uses listed on the <a href="http://code.google.com/p/outfox">Outfox homepage</a> is <i>Adding new I/O to web sites with Greasemonkey</i>. Interesting. It's one thing to include Outfox explicitly in a page, but can it possibly work when injected by GM? What about for a complex app like Gmail with multiple iframes, dynamic changes, refreshing, etc.?</p>
<p>To learn about Outfox (and for fun), I decided to write a quick GM script for Gmail that announces the senders and times of new messages (bold items) in the inbox. (I would have done subject and summary too, but Outfox 0.1.0 appears to have some unicode issues and balked at some of the Gmail separator characters. Less is more at this point.) The script makes the announcement when the Gmail interface first loads, any time Gmail automatically refreshes its inbox view, or when the user clicks the refresh link to check for new mail. It is smart enough to announce a given message only once, however, so you don't hear the same message over and over again on each refresh.</p>
<p>Yes. It does actually work.</p>
<p>To try this script, make sure you have the Greasemonkey 0.8 and Outfox 0.1 extensions installed on Firefox 3. (Or use the latest available version of each.) Then visit the following link to have GM install the script: <a href="/files/gmail_announcer.user.js">gmail_announcer.user.js</a>.</p>
<p>For reference, the entire script is listed below:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// ==UserScript==</span>
<span style="color: #006600; font-style: italic;">// @name Gmail Announcer</span>
<span style="color: #006600; font-style: italic;">// @namespace http://www.mindtrove.info/</span>
<span style="color: #006600; font-style: italic;">// @description Speaks new Gmail inbox messages using Outfox</span>
<span style="color: #006600; font-style: italic;">// @include https://mail.google.com/mail/*</span>
<span style="color: #006600; font-style: italic;">// @include http://mail.google.com/mail/*</span>
<span style="color: #006600; font-style: italic;">// @require http://outfox.googlecode.com/svn/trunk/js/outfox.js</span>
<span style="color: #006600; font-style: italic;">// ==/UserScript==</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> need_say <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> ids <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> sayMessages<span style="color: #009900;">&#40;</span>msgs<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>outfox.<span style="color: #660066;">defaults</span>.<span style="color: #660066;">config</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #006600; font-style: italic;">// outfox really needs a better way to detect ready ...</span>
	need_say <span style="color: #339933;">=</span> msgs<span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #003366; font-weight: bold;">var</span> header <span style="color: #339933;">=</span> <span style="color: #3366CC;">'New messages'</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> id <span style="color: #000066; font-weight: bold;">in</span> msgs<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #006600; font-style: italic;">// say all messages</span>
	<span style="color: #003366; font-weight: bold;">var</span> msg <span style="color: #339933;">=</span> msgs<span style="color: #009900;">&#91;</span>id<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> segs <span style="color: #339933;">=</span> msg.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Â»'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> sender <span style="color: #339933;">=</span> segs<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> time <span style="color: #339933;">=</span> segs<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">slice</span><span style="color: #009900;">&#40;</span>segs<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">search</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'â€¦'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>header<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	    outfox.<span style="color: #660066;">say</span><span style="color: #009900;">&#40;</span>header<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	    header <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	outfox.<span style="color: #660066;">say</span><span style="color: #009900;">&#40;</span>sender <span style="color: #339933;">+</span> <span style="color: #3366CC;">' at '</span> <span style="color: #339933;">+</span> time<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> onOutfoxReady<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>need_say<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #006600; font-style: italic;">// say anything already queued</span>
	sayMessages<span style="color: #009900;">&#40;</span>need_say<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	ids <span style="color: #339933;">=</span> need_say<span style="color: #339933;">;</span>
	need_say <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> onTableChange<span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> div <span style="color: #339933;">=</span> event.<span style="color: #660066;">target</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> trs <span style="color: #339933;">=</span> div.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'tr'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #003366; font-weight: bold;">var</span> count <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> new_ids <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> curr_ids <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> trs.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> tr <span style="color: #339933;">=</span> trs<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>tr.<span style="color: #660066;">innerHTML</span>.<span style="color: #660066;">search</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&amp;lt;b&amp;gt;'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	    <span style="color: #006600; font-style: italic;">// marked as a new message</span>
	    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>ids<span style="color: #009900;">&#91;</span>tr.<span style="color: #660066;">id</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> undefined<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #006600; font-style: italic;">// never announced</span>
		new_ids<span style="color: #009900;">&#91;</span>tr.<span style="color: #660066;">id</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> tr.<span style="color: #660066;">textContent</span><span style="color: #339933;">;</span>
		<span style="color: #339933;">++</span>count<span style="color: #339933;">;</span>
	    <span style="color: #009900;">&#125;</span>
	    <span style="color: #006600; font-style: italic;">// curr is announced + new</span>
	    curr_ids<span style="color: #009900;">&#91;</span>tr.<span style="color: #660066;">id</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> tr.<span style="color: #660066;">textContent</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #006600; font-style: italic;">// report if we can</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>sayMessages<span style="color: #009900;">&#40;</span>new_ids<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	ids <span style="color: #339933;">=</span> curr_ids<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> 
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> onDocumentChange<span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>event.<span style="color: #660066;">target</span>.<span style="color: #660066;">tagName</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">'DIV'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> div <span style="color: #339933;">=</span> event.<span style="color: #660066;">target</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> tables <span style="color: #339933;">=</span> div.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'table'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #000066; font-weight: bold;">in</span> tables<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	    <span style="color: #003366; font-weight: bold;">var</span> table <span style="color: #339933;">=</span> tables<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>table.<span style="color: #660066;">id</span> <span style="color: #339933;">!=</span> <span style="color: #3366CC;">''</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span>table.<span style="color: #660066;">getAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'role'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #006600; font-style: italic;">// watch just table changes from now on</span>
		<span style="color: #003366; font-weight: bold;">var</span> div <span style="color: #339933;">=</span> table.<span style="color: #660066;">parentNode</span>.<span style="color: #660066;">parentNode</span><span style="color: #339933;">;</span>
		div.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'DOMNodeInserted'</span><span style="color: #339933;">,</span> onTableChange<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		document.<span style="color: #660066;">removeEventListener</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'DOMNodeInserted'</span><span style="color: #339933;">,</span> 
					     onDocumentChange<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #006600; font-style: italic;">// start outfox</span>
		<span style="color: #003366; font-weight: bold;">var</span> div <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		document.<span style="color: #660066;">body</span>.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>div<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		outfox.<span style="color: #660066;">init</span><span style="color: #009900;">&#40;</span>div<span style="color: #339933;">,</span> onOutfoxReady<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #006600; font-style: italic;">// kick off initial read manually</span>
		onTableChange<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">'target'</span> <span style="color: #339933;">:</span> table.<span style="color: #660066;">parentNode</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	    <span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
document.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'DOMNodeInserted'</span><span style="color: #339933;">,</span> onDocumentChange<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://mindtrove.info/outfoxing-gmail-with-greasemonkey/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Android speech synth (where are you?)</title>
		<link>http://mindtrove.info/android-speech-synth-where-are-you/</link>
		<comments>http://mindtrove.info/android-speech-synth-where-are-you/#comments</comments>
		<pubDate>Tue, 18 Dec 2007 18:22:46 +0000</pubDate>
		<dc:creator>Peter Parente</dc:creator>
				<category><![CDATA[HCI]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[speech]]></category>

		<guid isPermaLink="false">http://pithy.tumblr.com/post/21897371</guid>
		<description><![CDATA[I took a peek at the Google Android class hierarchy today. As far as UI goes, it looks like there’s great support for 2D/3D visuals. There’s some APIs for doing MIDI and sampled sound output. There’s even a class for doing speech reco. What I don’t see is anything supporting synthesized speech output. That’s a [...]]]></description>
			<content:encoded><![CDATA[<p>I took a peek at the <a href="http://code.google.com/android/reference/packages.html">Google Android class hierarchy</a> today. As far as UI goes, it looks like there’s great support for 2D/3D visuals. There’s some APIs for doing MIDI and sampled sound output. There’s even a class for doing speech reco. </p>
<p>What I don’t see is anything supporting synthesized speech output. That’s a bit depressing. It would be a huge boon to have an open environment for developing mobile audio apps. Talking cell phones can be a bit pricey because they’re primarily intended as assistive technologies (i.e., small market). But I can imagine a ton of applications with speech-displays that could be useful to sighted and blind users alike: listening to your email while you walk instead of reading it on a tiny screen, announcements about upcoming meetings in your calendar, voice-jockey-like naming of songs about to come up on your MP3 playlist, spoken caller ID, …</p>
<p>Perhaps it’s possible to add custom classes to support <a href="http://freetts.sourceforge.net/docs/index.php">FreeTTS</a> or some other Java-accessible engine. However, it would be much nicer to have the speech API in the platform itself so it’s available everywhere. Maybe they left it out because all the free engines are too resource hungry? Somehow, I can’t imagine something like <a href="http://espeak.sourceforge.net/">espeak</a> being too bulky for a mobile platform. </p>
]]></content:encoded>
			<wfw:commentRss>http://mindtrove.info/android-speech-synth-where-are-you/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
