Hello,
I have used Microsoft SpeechLibrary 5.1 a COM dll to perform text to speech action in one of my web application. I have made reference of this dll file to my ASP.Net project and added the code like the following:
using SpeechLib;
protected void btnSubmit_Click(object sender, EventArgs e)
{
SpVoice voice = new SpVoice();
char[] text = { 's', 'p', 'e', 'a','k' };
for (int i = 0; i < text.Length; i++)
{
voice.Speak(text[i].ToString(), SpeechVoiceSpeakFlags.SVSFDefault);
}
}
But when I debug the code, I am getting the following exception
Attempted to access an unloaded appdomain. (Exception from HRESULT: 0x80131014)
at System.StubHelpers.StubHelpers.InternalGetCOMHRExceptionObject(Int32 hr, IntPtr pCPCMD, Object pThis)
at System.StubHelpers.StubHelpers.GetCOMHRExceptionObject(Int32 hr, IntPtr pCPCMD, Object pThis)
at SpeechLib.ISpeechVoice.Speak(String Text, SpeechVoiceSpeakFlags Flags)
at Test.btnSubmit_Click(Object sender, EventArgs e) in
And also getting one more exception sometimes
{System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
at SpeechLib.ISpeechVoice.Speak(String Text, SpeechVoiceSpeakFlags Flags)
at Test.btnSubmit_Click(Object sender, EventArgs e) in
I am using IIS7 webserver and the Website Properties are:
Application Pool: ASP.NET v4.0
Pipeline mode: Integrated