我写代码,我在它上面使用"System.Speech.Synthesis“库,但它默认只有英语,所以我如何才能将其更改为法语或其他语言??
代码的这一部分:
class Program
{
static void Main(string[] args)
{
using (SpeechSynthesizer synth = new SpeechSynthesizer()) { synth.Speak("Welcome To Calcualtor"); }
}
}我在网上搜索如何改变它,但我不太了解c# this whats found
因此,我非常感谢你们的帮助或建议,谢谢。
发布于 2017-03-05 05:19:31
您可以选择一个预先安装的语音,它将以您选择的语言说话。
我几乎可以肯定,如果您不选择任何语音,将使用您的计算机/服务器的默认语言。
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 !");
}https://stackoverflow.com/questions/42601263
复制相似问题