Вот мой код:
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
g(String valueString)
at System.Speech.Synthesis.VoiceInfo..ctor(VoiceObjectToken token)
at System.Speech.Internal.Synthesis.VoiceSynthesis.BuildInstalledVoices(Voice
Synthesis voiceSynthesizer)
at System.Speech.Internal.Synthesis.VoiceSynthesis..ctor(WeakReference speech
Synthesizer)
at System.Speech.Synthesis.SpeechSynthesizer.get_VoiceSynthesizer()
at System.Speech.Synthesis.SpeechSynthesizer.Speak(Prompt prompt)
at TTSTesting.Program.Speak(String _message) in C:\Users\ctanaka\Desktop\TTST
esting\TTSTesting\Program.cs:line 22