Tag: 文本到语音的

语音合成器“输入字符串格式不正确”

这是我的代码: string _message = “Hello world.”; SpeechSynthesizer _synth = new SpeechSynthesizer(); Prompt _prompt = new Prompt(_message); _synth.Speak(_prompt); 我不能为我的生活弄清楚究竟是什么导致了这个错误: “输入字符串的格式不正确。” 导致此错误的行是我调用_synth.Speak(_prompt); 编辑:我已经在我的桌面计算机上尝试了这个代码,它工作正常,所以在我的笔记本电脑上安装有问题。 我还不太确定如何解决这个问题…… 编辑: 堆栈跟踪: System.FormatException: Input string was not in a correct format. at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffe r& number, NumberFormatInfo info, Boolean parseDecimal) at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo in fo) at System.Speech.Internal.SapiAttributeParser.GetCultureInfoFromLanguageStrin […]