Google chrome Chrome OS德语版是Chrome OS上正确的默认语音吗?
我正在使用Web语音API进行文本到语音转换,需要能够确定默认语音。为此,我调用Google chrome Chrome OS德语版是Chrome OS上正确的默认语音吗?,google-chrome,speech-synthesis,google-chrome-os,chromebook,webspeech-api,Google Chrome,Speech Synthesis,Google Chrome Os,Chromebook,Webspeech Api,我正在使用Web语音API进行文本到语音转换,需要能够确定默认语音。为此,我调用speechSynthesis.getVoices()并枚举这些声音,以找到默认值为true的声音 我在美国,可以在我的所有设备上使用美国英语语言环境。在Windows和Mac上的Chrome中,返回的默认语音是谷歌美国英语。然而在Chromebook上,返回的默认语音是Chrome OS德语这真的是正确的默认值吗? Chromebook上是否有我遗漏的其他区域设置?我曾尝试更改ChromeVox的默认语音(在我更改
speechSynthesis.getVoices()
并枚举这些声音,以找到默认值为true的声音
我在美国,可以在我的所有设备上使用美国英语语言环境。在Windows和Mac上的Chrome中,返回的默认语音是谷歌美国英语。然而在Chromebook上,返回的默认语音是Chrome OS德语这真的是正确的默认值吗?
Chromebook上是否有我遗漏的其他区域设置?我曾尝试更改ChromeVox的默认语音(在我更改之前也是ChromeOS德语),但没有成功
或者是否有某种方法可以将语言传递给getVoices()
HTML
我的页面的HTML语言设置为US English
<!DOCTYPE html>
<html lang="en-US">
我明白了。我的默认设置为德语。Treehouse的本指南解释了流程: 明确地说,您可以这样做:
var utterance = new SpeechSynthesisUtterance('Hello Treehouse');
var voices = window.speechSynthesis.getVoices();
utterance.voice = voices.filter(function(voice) { return voice.lang == 'en-GB'; })[0];
window.speechSynthesis(utterance);
然后只需将语言更改为您需要的任何语言(即美式英语等)。您可以从上面列出的voices变量中获得列表,并可以在开发工具中进行探索。FWIW-当ChromeVox首次启用时,我管理的所有Chrome电子书学区默认为Chrome OS German。它们是Acer C720s。更清楚一点,它们显示德语,但声音仍然是英语。我的英国戴尔11 Chromebook是一样的;默认标志设置为德语语音!如果将消息上的lang设置为“en GB”,则它会自动使用GB语音,而无需专门检查语音。如果在
SpeechSynthesistTerrance
上设置lang,则似乎会自动使用第一个GB语音,这比过滤语音稍微简单:)
var utterance = new SpeechSynthesisUtterance('Hello Treehouse');
var voices = window.speechSynthesis.getVoices();
utterance.voice = voices.filter(function(voice) { return voice.lang == 'en-GB'; })[0];
window.speechSynthesis(utterance);