I am trying to change VoiceGender of SpeechSynthesizer object:
SpeechSynthesizer synth = new SpeechSynthesizer();
synth.SelectVoiceByHints(VoiceGender.Male, VoiceAge.Adult);
synth.Speak("Hello! Why is the voice still female?");
The program compiles and runs without errors but the voice is a female voice.
EDIT: I checked installed voices with:
foreach (var v in synth.GetInstalledVoices().Select(v => v.VoiceInfo))
{
Console.WriteLine("Name:{0}, Gender:{1}, Age:{2}",
v.Description, v.Gender, v.Age);
}
Which returned the following:
Name:Microsoft Hazel Desktop - English (Great Britain), Gender:Female, Age:Adult
Name:Microsoft David Desktop - English (United States), Gender:Male, Age:Adult
Name:Microsoft Zira Desktop - English (United States), Gender:Female, Age:Adult
EDIT2: Tested it on a different PC and the program works as expected.