谷歌浏览器(Windows) - 如何添加缺少的语音合成语音



我将HTML5语音合成API与Google Chrome(Windows(一起使用。不幸的是,当我测试可用的声音时 - 我没有看到挪威语 语音(例如(

所以我的问题是 - 是否可以添加缺失的声音 在铬?或者该列表是否对所有 Chrome (Windows( 安装都有效?

在我的安卓设备上 - 可用语音的列表要大得多。 但是 - 在Windows设备上 - 缺少一些重要的声音。

我在Google Chrome for Windows上看到的声音如下:

PL-PL en-US 德德 en-US en-GB en-GB ES-ES ES-US 法国-法国 嗨嗨 身份证 信息技术-信息技术 贾-JP 科克尔 荷兰-荷兰 PL-PL 铂-BR 茹茹 中乙二氮 zh-HK zh-TW

谢谢 话筒

该列表是特定于浏览器版本的,同一浏览器的版本(例如 Chrome(在不同的操作系统上将具有不同的列表。似乎只有Safari和Chrome是多语言的,Opera和Firefox有英语语音,而IE没有。Chrome for Mac和Ubuntu的声音比Chrome for Windows多得多。据推测,较新版本的Chrome比旧版本有更多的声音。

我写了一个显示浏览器声音的jsbin:
https://jsbin.com/ginanegoqu/edit?js,output

if ('speechSynthesis' in window) {
// Start an html table for languages details
var text = '<table border=1><tr><th>Default<th>Language<th>Local<th>Name<th>URI</tr>';
// Get voices; add to table markup
function loadVoices() {
var voices = speechSynthesis.getVoices();
voices.forEach(function(voice, i) {
// Add all details to table
text += '<tr><td>' + voice.default + '<td>'
+ voice.lang + '<td>' + voice.localService
+ '<td>' + voice.name + '<td>' + voice.voiceURI;
});
}
loadVoices();
langList.innerHTML = text;
// Chrome loads voices asynchronously.
window.speechSynthesis.onvoiceschanged = function(e) {
loadVoices();
langList.innerHTML = text;
}
}

最新更新