我有以下程序:語音合成,無法選擇安裝語音
SpeechSynthesizer synth = new SpeechSynthesizer();
List<InstalledVoice> installedVoices = new List<InstalledVoice>();
foreach (InstalledVoice voice in synth.GetInstalledVoices())
{
installedVoices.Add(voice);
Console.WriteLine(voice.VoiceInfo.Name);
}
synth.SelectVoice(installedVoices[1].VoiceInfo.Name);
synth.Speak("This is in English");
安裝的聲音的輸出是這樣的:
Microsoft Anna
Microsoft Server Speech Text to Speech Voice (en-GB, Hazel)
Microsoft Server Speech Text to Speech Voice (fr-CA, Harmonie)
Microsoft Server Speech Text to Speech Voice (nl-NL, Hanna)
當我運行synth.SelectVoice(installedVoices[0].VoiceInfo.Name);
程序它工作沒有任何問題。 當synth.SelectVoice(installedVoices[1].VoiceInfo.Name);
運行它得到淡褐色讀一句,我得到以下SystemArgumentException
:
{"Cannot set voice. No matching voice is installed or the voice was disabled."}
而且所有的聲音都啓用。 我已經安裝了以下幾件事:
- 微軟語音平臺 - 運行時(第11版)
- 微軟語音平臺 - 軟件開發工具包(SDK)(第11版)
- 而其他語言所看到的打印清單。
而且我也跟着this指導讓我的語言我的OS(win7x64)的認可。 我怎麼只能使用安娜?