gpt4 book ai didi

javascript - 下面的代码适用于 chrome,但同样的代码不适用于 Internet Explorer。如何在 Internet Explorer 中使用语音合成?

转载 作者:行者123 更新时间:2023-11-30 20:57:02 25 4
gpt4 key购买 nike

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>

<body onload="myFunction()">
<script>
function myFunction() {

// Create the utterance object setting the chosen parameters
var utterance = new SpeechSynthesisUtterance();

var myarray = new Array(4);

myarray[0] = "Move Bay from door 10 to 20";
utterance.text = myarray[0];
utterance.lang = "ar-uk";
speechSynthesis.speak(utterance);
}
</script>
</body>
</html>

将文本传递给语音合成属性文本并尝试将文本转换为语音

最佳答案

看这里:SpeechSynthesisUtterance Docs

IE不支持。

关于javascript - 下面的代码适用于 chrome,但同样的代码不适用于 Internet Explorer。如何在 Internet Explorer 中使用语音合成?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47550659/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com