我是编程新手。我想改变系统声音的性别和年龄。在VB.NET中的演讲。喜欢这个问题
How I can change the voice synthesizer gender and age in C#
所以,我很困惑如何将此代码声明为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); }
答案 0 :(得分: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
但是这段代码只能获得已安装语音的列表。要为syntesizer设置语音,您需要进行以下操作:
synthesizer.SelectVoiceByHints(VoiceGender.Female, VoiceAge.Adult);
这里有关于此的详细信息(包括VB.NET):https://msdn.microsoft.com/en-us/library/ms586877 以下是VB上的简单代码示例:http://www.phon.ucl.ac.uk/courses/spsci/compmeth/speech/synthesis.html