C# 如何更改System.Speech.Synthesis上的语言?
我写代码,我使用它的“System.Speech.Synthesis”库,但它默认只使用英语,所以我怎么能把它改成法语或其他语言 这部分代码:C# 如何更改System.Speech.Synthesis上的语言?,c#,speech,C#,Speech,我写代码,我使用它的“System.Speech.Synthesis”库,但它默认只使用英语,所以我怎么能把它改成法语或其他语言 这部分代码: class Program { static void Main(string[] args) { using (SpeechSynthesizer synth = new SpeechSynthesizer()) { synth.Speak("Welcome To Calcualtor"); } } } 我
class Program
{
static void Main(string[] args)
{
using (SpeechSynthesizer synth = new SpeechSynthesizer()) { synth.Speak("Welcome To Calcualtor"); }
}
}
我在网上搜索如何改变它,但我对c#知之甚少
这就是我
所以我感谢你们的帮助和建议,谢谢你们 您可以选择一种预装语音,该语音将使用您选择的语言 我几乎可以肯定,如果您不选择任何语音,您的计算机/服务器将使用默认语言
using (SpeechSynthesizer synthesizer = new SpeechSynthesizer())
{
synthesizer.SetOutputToDefaultAudioDevice();
// this
synthesizer.SelectVoice("ScanSoft Virginie_Dri40_16kHz");
// or this
synthesizer.SelectVoiceByHints(VoiceGender.Neutral, VoiceAge.NotSet, 0, CultureInfo.GetCultureInfo("fr-fr"));
synthesizer.Speak("Bonjour !");
}