0
我想在Eric's blog的幫助下試驗speechSynthesis API。speechSynthesis API不起作用
This fiddle工作正常,這意味着有網站no issue with the audio device permission(糾正我,如果我錯了)。我做了我的own fiddle,但似乎沒有工作(我的意思是不是說你好世界)。
這裏是我的代碼:
function speak() {
var msg = new SpeechSynthesisUtterance('Hello world');
msg.rate = 0.7;
msg.pitch = 1;
window.speechSynthesis.speak(msg);
}
<button title="Click to listen" onclick="speak()">
Say hello world
</button>
更新:如所指出的enhzflep但是代碼在這裏工作沒有JSFiddle's editor
任何建議,這類人?