A good Text-to-Speech JavaScript library [closed]

五迷三道 提交于 2019-12-03 02:50:01

问题


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.


回答1:


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.




回答2:


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/



来源:https://stackoverflow.com/questions/11279291/a-good-text-to-speech-javascript-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!