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

4

I am using Microsoft.Speech SDK (11.0) for converting text to speech. I have a windows forms application and I am using a very basic code to speak the entered text, but it is getting failed. Here is my code on the click of the button:

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

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

FileNotFoundException was unhandled
Exception from HRESULT: 0x8004503A

And here is the complete 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 is it that causing this error?

Thanks

c#
speech-synthesis
asked on Stack Overflow Jun 18, 2012 by Prashant

3 Answers

3

As Microsoft recommend: "The Speech Platform Runtime 11 and the Speech Platform SDK 11 do not include Runtime Languages for speech recognition or for speech synthesis (TTS or text-to-speech). You must install them separately."

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

answered on Stack Overflow Sep 6, 2012 by Janos
0

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

  1. Be sure your ms speech sdk installed fine and well configured.
  2. dGo Start > Control Panel > Easy of Access > Speech Recognition and click Text To Speech.
  3. Now start your app with full UAC.
  4. Try to use "try-catch" block.
  5. Also take a look at there; My search ending up here; https://forums.asp.net/p/1105408/2028838.aspx#2028838

( For 1> http://msdn.microsoft.com/en-us/library/hh362873.aspx ) ( For 2> Test the "speech engine", We'll sure that sdk not failed, your app has a bug ) ( For 3> Run the application with administration rights. )

Last and the big way solving that problem; Try to uninstall sdk, clean registry-temp etc. and re-install the sdk. And try to add the necessary dll's from sdk to your application with nuget packing system( if you can't find ms speech sdk and you can use the anotherone find similar sdk with nuget).

answered on Stack Overflow Jun 18, 2012 by Lost_In_Library
0

I had a similar problem and resolved it by downloading the correct run time.

At first i downloaded "MSSpeech_SR_en-CA_TELE.msi" which is the Speech Recognition file. You would need to download the language pack which has the MSSpeech_TTS starting and not the MSSpeech_SR which is the speech recognition pack.

Hope this helps.

answered on Stack Overflow Nov 19, 2014 by cyj89

User contributions licensed under CC BY-SA 3.0