Using Google Text-To-Speech in Javascript

后端 未结 6 2053
一生所求
一生所求 2020-12-12 10:58

I need to play Google text-to-speech in JavaScript.
The idea is to use the web service:

http://translate.google.com/translate_t

6条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-12 11:05

    Another option now may be HTML5 text to speech, which is in Chrome 33+ and many others.

    Here is a sample:

    var msg = new SpeechSynthesisUtterance('Hello World');
    window.speechSynthesis.speak(msg);
    

    With this, perhaps you do not need to use a web service at all.

提交回复
热议问题