It seems I can’t get the method SelectVoiceByHintsto work, the voice never changes. If you want to switch to a male voice, then this code will work:
using (var synth = new SpeechSynthesizer())
{
var voices = synth.GetInstalledVoices().Dump();
var male = voices.FirstOrDefault(v => v.VoiceInfo.Gender == VoiceGender.Male);
if (male != null)
{
synth.SelectVoice(male.VoiceInfo.Name);
}
synth.Speak("Hello");
}
source
share