<分区>
我想为我的交互式训练集制作一个文本转语音程序。我使用了 System.Speech
库,但声音始终是女性。我希望有些句子用男声朗读,有些句子用女声朗读。 (这两个声音是我唯一需要的。)
我使用的是 Windows 8 Pro 和 Visual Studio 2010。我只能看到一个语音包,即 Microsoft Zira Desktop。
我的代码如下。如何配置使用男声?
SpeechSynthesizer synth = new SpeechSynthesizer();
synth.Rate = 1;
synth.Volume = 100;
synth.SelectVoiceByHints(VoiceGender.Male,VoiceAge.Adult);
synth.SpeakAsync(label18.Text);