我正在尝试让Web Speech API中的女性语音接受“美国英语”。
下面是我的代码:
var synth = window.speechSynthesis;
var voiceOptioins = synth.getVoices();
var voiceChoice = voiceOptioins[5];
var utterThis = new SpeechSynthesisUtterance(textToSpeech);
utterThis.voice = voiceChoice;
synth.speak(utterThis);
使用此代码,目前,男性声音带有超重低音。我试图更改voiceOptioins[<index>]
中的索引:尝试使用0、5、10。使用所有这些索引,只会发出相同的男性声音。
如何选择特定的声音?
谢谢。