Click here to Skip to main content
15,896,912 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
After a Windows update my program:

TextToSPeechForWindows

Shows an error when running:


See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Runtime.InteropServices.COMException (0x80045039): Exception from HRESULT: 0x80045039
   at SpeechLib.ISpeechVoice.GetVoices(String RequiredAttributes, String OptionalAttributes)
   at SpeakTextSimple.FormMain.FormMain_Load(Object sender, EventArgs e)
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.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.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

What I have tried:

I debugged, and the problem is at "GetVoices":


<pre>foreach (ISpeechObjectToken Token in SP.GetVoices(string.Empty, string.Empty))
            {
                comboBoxVoice.Items.Add(Token.GetDescription(49));
            }



An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in SpeakTextSimple.exe

Additional information: Exception from HRESULT: 0x80045039



I tried running as admin and still an error appears.
Posted
Updated 13-Feb-17 0:55am
v2
Comments
Richard MacCutchan 13-Feb-17 5:39am    
Looks like some component may be missing from your system. Google for the error code and yo will likely find some suggestions.

1 solution

I used

SpeechSynthesizer Class (System.Speech.Synthesis)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900