Chrome Extension developers that want to add synthesized speech to extensions and Chrome-packaged apps are in luck. Google announced a new Text-to-Speech API for Chrome extensions yesterday, with examples and two sample voices.
According to Google engineer Dominic Mazzoni, a few hacks have enabled text-to-speech already. This involves tricks like sending text to a remote server and returning an MP3 that’s played back with HTML5 audio. Smart approach in lieu of an official way to do it, but now Google has an easier (and less bandwidth-intensive) way.
The API is already used to power the ChromeVox screen reader for visually impaired users.
In addition to the main API, Google also introduced the TTS Engine API which allows developers to implement a Text-to-Speech (TTS) engine. Google also supplies two voices implemented with the TTS Engine API that use Google’s Native Client SDK for speech. Note that both are female and geared for U.S. English, so there’s a long way to go before there’s support for all languages. Google has also provided a few extensions and one app that makes use of the TTS API.
Users that have Chrome on Mac OS X or Windows, or those using Chrome OS, should be able to use the native client voices immediately. Linux users will have to download a voice from the Chrome Web Store.
It’s good to see Google paying attention to accessibility and providing this sort of functionality for developers. This will be important for a lot of business and government use of Chrome. But it’s too bad there’s not a more universal API for all browsers. However, there is speak.js, which is an open source speech synthesizer. However, it looks a bit more clunky and only works in Firefox and Chrome.