gpt4 book ai didi

javascript - 在 chrome speechSynthesis 中获取额外的声音列表

转载 作者:行者123 更新时间:2023-11-28 02:20:46 31 4
gpt4 key购买 nike

我尝试使用 Google speechSythesis(网络语音 API),它给我的声音比我预期的要少。在 chrome 中,我有 22 个声音,但在其他浏览器中,我有 3 个声音,有什么办法可以增加声音的数量

<html>
<head>
<script>
function test(){
console.log(window.speechSynthesis.getVoices())
}

const getVoices = () => {};

getVoices();
if(window.speechSynthesis.onvoiceschanged !== undefined) {
window.speechSynthesis.onvoiceschanged = getVoices;
}

</script>
</head>
<body>
<a href="#" onclick="test()">Test</a>
</body>
</html>

最佳答案

我相信除了操作系统上安装的兼容语音外,不同的浏览器还会包含不同的语音

在我看来,浏览器应该提供您的操作系统已安装的语音,此外还可以提供自己的浏览器语音

关于javascript - 在 chrome speechSynthesis 中获取额外的声音列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57830011/

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