System.Runtime.InteropServices.COMException crashes IIS pool

SoopsySop

New Member
I am using the Microsoft Speech COM object in my asp.net app, for text to speech. When I debug on my local machine everything works fine, the text is read out loud, etc. I am using a thread to start the text to speech.\[code\]public partial class Tracker: System.Web.UI.Page{ protected static SpVoice objSpeech = new SpVoice(); protected delegate void SpeechWorker(); protected static Thread SpeechThread;...... protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { InitSpeechThread(TextToSpeechRead); }}protected static void InitSpeechThread(SpeechWorker doWork) { SpeechThread = new Thread(new ThreadStart(doWork)); SpeechThread.Start(); } protected void TextToSpeechRead(string text) { objSpeech.Speak(text, SpeechVoiceSpeakFlags.SVSFDefault); }\[/code\]Once I upload the website to the IIS Server the speech COM seems to crash and stop my Application Pool. I must start it manually after.Here is an output from the eventviewer:\[code\]Application: w3wp.exeFramework Version: v4.0.30319Description: The process was terminated due to an unhandled exception.Exception Info: System.Runtime.InteropServices.COMExceptionStack: at SpeechLib.SpVoiceClass.Speak(System.String, SpeechLib.SpeechVoiceSpeakFlags) at QCTracker.TextToSpeechRead() at System.Threading.ExecutionContext.runTryCode(System.Object) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode, CleanupCode, System.Object) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) at System.Threading.ThreadHelper.ThreadStart() Application: w3wp.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.Runtime.InteropServices.COMException Stack: at SpeechLib.SpVoiceClass.Speak(System.String, SpeechLib.SpeechVoiceSpeakFlags) at QCTracker.TextToSpeechRead() at System.Threading.ExecutionContext.runTryCode(System.Object) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode, CleanupCode, System.Object) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) at System.Threading.ThreadHelper.ThreadStart()\[/code\]Can anyone shed some light on this issue?
 
Back
Top