I am looking for a good text to speech javascript library for my application. I looked around and saw Jtalk and speak.js. But I'm not sure which one to go forth with. I'm curious to know from people about the pros and cons of them and I'm interested to know if there's any other Javascript plugin you guys came across.
I am basically visualizing a animation and I wanted to add some audio for sight-impaired people to tell them what is happening.
On any web page, open up the developer tools console and enter the following code: speechSynthesis. speak(new SpeechSynthesisUtterance("Hello, this is your browser speaking.")); Your browser will speak the text "Hello, this is your browser speaking." in its default voice.
UPDATE 2018
Modern browser has built in TTS
if ('speechSynthesis' in window) {
var msg = new SpeechSynthesisUtterance('Hello World');
window.speechSynthesis.speak(msg);
}
speechSynthesis
Deprecated
If you don't want to write a lot of code (or import some library that you don't understand), I suggest you use Google TTS services. It's quite simple. For example you have a text like: welcome to Stack overflow
you can call like this:
http://translate.google.com/translate_tts?ie=UTF-8&q=Welcome%20to%20stack%20overflow&tl=en&total=1&idx=0&textlen=23&prev=input
This will return an audio file reading that text. Then your job is to use browser audio to play it. Nice and easy.
PS: Google TTS has really true voice.
Example: http://jsfiddle.net/qspcL/
Reference from: http://jnjnjn.com/187/playing-audio-on-the-ipad-with-html5-and-javascript/
Well I suggest you use JTtalk. It depends what your target crowd is, because legally blind and what you may think is blind can differ and not everyone knows Braille. The benefits I saw of Jtalk really relied on the examples it had, and how well they worked. To do our entire front-end part of the project with JTalk only took us 2 days, because we pretty much just edited the examples it had. Speak.js had a more difficult learning curve in my/my group's opinion. However, we found that the speech was a bit slurred and had comprehension issues, especially for documents where there were a lot of names (example stock articles mentioning companies). This is why we moved to Braille.
My senior design project was for the blind, however we realized that the text to speech wasn't where we wanted to go because we felt Braille was better. With Braille you can multitask better, easily go back and pause and most blind people can read Braille a lot faster then they can listen.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With