您应该使用speechSynthesis.getVoices()
来获取所有声音的列表。这是 Google Chrome 33 的输出:
[{
"default": true,
"localService": false,
"lang": "en-US",
"name": "Google US English",
"voiceURI": "Google US English"
}, {
"default": false,
"localService": false,
"lang": "en-GB",
"name": "Google UK English Male",
"voiceURI": "Google UK English Male"
}, {
"default": false,
"localService": false,
"lang": "en-GB",
"name": "Google UK English Female",
"voiceURI": "Google UK English Female"
}, {
"default": false,
"localService": false,
"lang": "es-ES",
"name": "Google Español",
"voiceURI": "Google Español"
}, {
"default": false,
"localService": false,
"lang": "fr-FR",
"name": "Google Français",
"voiceURI": "Google Français"
}, {
"default": false,
"localService": false,
"lang": "it-IT",
"name": "Google Italiano",
"voiceURI": "Google Italiano"
}, {
"default": false,
"localService": false,
"lang": "de-DE",
"name": "Google Deutsch",
"voiceURI": "Google Deutsch"
}, {
"default": false,
"localService": false,
"lang": "ja-JP",
"name": "Google 日本人",
"voiceURI": "Google 日本人"
}, {
"default": false,
"localService": false,
"lang": "ko-KR",
"name": "Google 한국의",
"voiceURI": "Google 한국의"
}, {
"default": false,
"localService": false,
"lang": "zh-CN",
"name": "Google 中国的",
"voiceURI": "Google 中国的"
}, {
"default": false,
"localService": true,
"lang": "",
"name": "native",
"voiceURI": "native"
}]