如何在Web Speech API中获得特定的女性语音语音合成?

时间:2019-04-23 12:03:41

标签: javascript google-chrome speech-synthesis

我正在尝试让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。使用所有这些索引,只会发出相同的男性声音。

如何选择特定的声音?

谢谢。

0 个答案:

没有答案