mindtrove Collecting ideas since 1980

30Jun/100

Buildbot Button Chrome Extension

To learn about Chrome extensions, I wrote a little ditty that gives a glimpse of the status of all builders on a Buildbot server. The server must be v0.8 or higher as the extension relies on the new JSON REST API.

Buildbot extension popup screenshot

The button icon in the Chrome toolbar reflects if a build is running or not, and indicates the number of builders that failed the last time they ran. Clicking the button reveals a popup showing details about builders, builds, and build steps. Almost everything is a link leading to buildbot web status pages with additional info. There's also optional audio icons that indicate if a build is starting, has succeeded, or has failed.

The extension satisfies my needs, but is far from perfect. For example, if the server has a large number of builders, the XHR fetch for all the builder info can fail because the URL is too long. Likewise, the popup can grow too large to be useful. I've open sourced the code on GitHub so anyone interested can contribute patches or fork.

10May/100

JSonic: Speech and sound using HTML5

I've released a new library called JSonic for text-to-speech synthesis and sound playback in browsers supporting HTML5 <audio>. 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 JS interface. The TTS synthesis is implemented server-side using espeak and Tornado. Other server implementations are possible as long as they adhere to the REST API, and other speech engines can be plugged in rather easily.

The UNC Open Web group is looking to use JSonic to build self-voicing web games for kids with disabilities. I've already ported my Spaceship! game (also available on GitHub) to use it instead of Outfox, and hope deploy it somewhere in the near future.

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.

19Feb/107

HTML5 audio caching

One of my latest coding endeavors is a text-to-speech interface for JavaScript using HTML5 <audio> 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 turns out that browser caching behavior for <audio> data varies wildly among browsers. The following table shows the HTML5 <audio> 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.

Browser <audio> Behavior
Firefox 3.6 Respects cache headers for the sound data. Only contacts the server when the cache item expires. <audio> elements pointing to the same src reuse the cache data.
Chrome 5.0.322.2 Contacts the server on every load(). When it receives a 304 response, does not refetch content.*
Safari 4.0.4 Contacts the server to fetch first two bytes of the audio file on every load(). 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.
Webkit r54921 Same behavior as Safari 4.0.4.

* 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 onended event even before the audible output finishes.

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 <audio> API? If so, please let me know. If not, yikes: <audio> support has definite room for improvement.

30Nov/093

Ken Burns Effect in Dojo

I saw a reference to the jQuery CrossSlide plug-in many moons ago. For some dojo.anim practice, I decided to implement its Ken Burns effect in a reusable Dojo widget a few days later. The code then collected dust in my Dropbox until today when I finally got around to sharing it.

Below is an example instance of the widget panning, zooming, and crossfading three images. The BSD code for the widget is in KenBurns.js. The code for this particular demo can be seen by viewing the source of kenburns-demo.html.

I didn't take the time to comment this little experiment. If you'd like more info about how to use it or how it works, drop me a comment.

28Nov/090

Spaceship! code at GitHub

I cloned the code for Spaceship! at GitHub to facilitate easier development by anyone interested. I'll push any future improvements I make there and consider my personal subversion repository dead.

http://github.com/parente/spaceship