Text-to-Speech using Microsoft.Speech SDK throwing FileNotFoundException?

I use the Microsoft.Speech SDK (11.0) to convert text to speech. I have an application for Windows forms and I use very simple code to speak the entered text, but it does not work. Here is my button click code:

SpeechSynthesizer syn = new SpeechSynthesizer(); PromptBuilder pb = new PromptBuilder(); pb.AppendText("Welcome, everyone"); syn.Speak(pb); 

The error is in the last line of the above code:

 FileNotFoundException was unhandled Exception from HRESULT: 0x8004503A 

And here is the full stack trace:

 at Microsoft.Speech.Synthesis.SpeechSynthesizer.SpeakPrompt(Prompt prompt, Boolean async) at Microsoft.Speech.Synthesis.SpeechSynthesizer.Speak(Prompt prompt) at Microsoft.Speech.Synthesis.SpeechSynthesizer.Speak(PromptBuilder promptBuilder) at MSSpeechSynth.Form1.btnSpeak_Click(Object sender, EventArgs e) in C:\Users\prashant.k\Desktop\MSSpeechSynth\MSSpeechSynth\Form1.cs:line 30 at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(Form mainForm) at MSSpeechSynth.Program.Main() in C:\Users\prashant.k\Desktop\MSSpeechSynth\MSSpeechSynth\Program.cs:line 18 at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() 

What causes this error?

thanks

+4
source share
3 answers

I worked with sdk 5.1. So I'm not an expert ... But I will try to help.

  • Make sure your ms sdk is installed properly and well configured.
  • dGo Start> Control Panel> Easy Access> Speech Recognition and click Text to Speech.
  • Now run the application with full UAC.
  • Try using a try-catch block.
  • Also take a look there; My search ends here; https://forums.asp.net/p/1105408/2028838.aspx#2028838

(For 1> http://msdn.microsoft.com/en-us/library/hh362873.aspx ) (For 2> Check the "speech engine", we will make sure that sdk failed, your application has an error) (For 3> Run the application with administrator privileges.)

The last and great way to solve this problem; Try to remove sdk, clean the registry, etc. And reinstall sdk. And try adding the necessary dll from sdk to your application with the nuget packaging system (if you cannot find ms sdk of speech, and you can use anotherone find like sdk with nuget).

0
source

As Microsoft recommends: "Runtime 11 for the speech platform and SDK 11 for the speech platform do not include runtime languages ​​for speech recognition or speech synthesis (TTS or text-to-speech). You must install them separately."

I solved the same problem by installing one of the runtime languages: http://www.microsoft.com/en-us/download/details.aspx?id=27224

+2
source

I had a similar problem and resolved it by loading the correct runtime.

First I downloaded "MSSpeech_SR_en-CA_TELE.msi", which is a speech recognition file. You will need to download the language pack with the launch of MSSpeech_TTS, not MSSpeech_SR, which is a speech recognition package.

Hope this helps.

0
source

All Articles