Tag: system.speech.recognition

如何在ASP.NET MVC中使用Windows语音合成器

我尝试使用System.Speech类在ASP.NET mvc应用程序中生成语音。 [HttpPost] public ActionResult TTS(string text) { SpeechSynthesizer speechSynthesizer = new SpeechSynthesizer(); speechSynthesizer.Speak(text); return View(); } 但它给出了以下错误。 System.InvalidOperationException: ‘An asynchronous operation cannot be Started at this time. Asynchronous operations may only be started within an asynchronous handler or module or during certain events in the Page lifecycle. If this exception occurred while executing a […]