System.Speech.Synthesis.SpeechSynthesizer - how to set up voice?

SpeechSynthesizer allows you to select different voices using the SelectVoiceByHints(VoiceGender, VoiceAge) function (as I understand it). But no tuning occurs if I change the gender and age of the voice.

Can you explain why? And if I do something wrong, what is the right way to do this?

Thanks.

+4
source share
2 answers

Here is a small test program that you can use to detect installed voices:

 using System; using System.Speech.Synthesis; // Add reference to System.Speech class Program { static void Main(string[] args) { var synth = new SpeechSynthesizer(); foreach (var voice in synth.GetInstalledVoices()) { Console.WriteLine(voice.VoiceInfo.Description); } Console.ReadLine(); } } 

Exit on my machine: Microsoft Anna - English (United States)

This is the only and only default voice that comes with Windows afaik. Which, of course, will explain why gender and age changes do not affect your car.

+13
source

According to the function name, I would say that it is a selector for the established voices. He does not tune the voice in any way, but selects one of the repos according to your specified parameters.

So, if only one vote is installed, he can choose only one.

+2
source

Source: https://habr.com/ru/post/1312863/


All Articles