1

I am a novice in programming. I would like to change the gender and age of the voice of System. Speech in VB.NET. Like this question How I can change the voice synthesizer gender and age in C#
So, I am confused how to declare this code to VB.NET

foreach (var v in synthesizer.GetInstalledVoices().Select(v => v.VoiceInfo))
    {
        Console.WriteLine("Name:{0}, Gender:{1}, Age:{2}",
          v.Description, v.Gender, v.Age);
    }

Thanks for advance
Community
  • 1
  • 1
Danny
  • 171
  • 1
  • 1
  • 15

1 Answers1

0
For Each v As var In synthesizer.GetInstalledVoices().[Select](Function(v) v.VoiceInfo)
    Console.WriteLine("Name:{0}, Gender:{1}, Age:{2}", v.Description, v.Gender, v.Age)
Next

But this code only get the list of installed voices. To set the voice for your syntesizer you need to make following:

synthesizer.SelectVoiceByHints(VoiceGender.Female, VoiceAge.Adult);

here is detailed information about this (including VB.NET): https://msdn.microsoft.com/en-us/library/ms586877 Here is an example of simple code on VB: http://www.phon.ucl.ac.uk/courses/spsci/compmeth/speech/synthesis.html

Ivan Yuriev
  • 488
  • 8
  • 14