Posted by Andrew.
Chrome now includes a Text-to-Speech (TTS) API that’s simple to use, powerful, and flexible for users. It provides native support for speech on Windows (using SAPI 5), Mac OS X, and Chrome OS, using speech synthesis capabilities provided by the operating system. On all platforms, the user can install extensions that register themselves as alternative speech engines.
If you are a Chrome developer, you can use the chrome.tts module to play synthesized text-to-speech from your extension or packaged app now. With the new API, you just need to add "tts" to your permissions and then write:
chrome.tts.speak("Hello, world!:);
It's also very easy to change the rate, pitch, and volume. Here's an example that speaks more slowly:
chrome.tts.speak("Can you understand me now?", {rate: 0.6});
A complete description of all options can be found in the speak() method documentation.
To stop speaking immediately, just call stop():
chrome.tts.stop();
Here are three examples you can try now:
Text-to-Speech API for Chrome extensions