テキスト読み上げTTSを実行するASP.NETアプリケーションがあります。コードはローカルマシンでは正常に機能しますが、Windows 2008R2サーバーのEnterprise64ビットに展開すると、アプリケーションプールがクラッシュします。アプリケーションはv4.0.NETフレームワークで構成されています。サーバーでIIS7を使用しています。以下は、アプリケーションプールがクラッシュしたときのエラーです。
Service Unavailable
HTTP Error 503. The service is unavailable.
これが私がもっと簡単に追加すべきコードです
MemoryStream ms = new MemoryStream();
context.Response.ContentType = "audio/wav";
Thread t = new Thread(() =>
{
SpeechSynthesizer ss = new SpeechSynthesizer();
ss.SetOutputToWaveStream(ms);
ss.Speak(context.Request.QueryString["tts"]);
});
t.Start();
t.Join();
ms.Position = 0;
ms.WriteTo(context.Response.OutputStream);
context.Response.End();
どんな助けでもありがたいです
ありがとう
例外の詳細は次のとおりです
An unhandled exception occurred and the process was terminated.
Application ID: /LM/W3SVC/17/ROOT
Process ID: 5340
Exception: System.UnauthorizedAccessException
Message: Retrieving the COM class factory for component with CLSID {A832755E-9C2A-40B4-89B2-3A92EE705852} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
StackTrace: at System.Speech.Internal.Synthesis.VoiceSynthesis.Speak(Prompt prompt)
at System.Speech.Synthesis.SpeechSynthesizer.Speak(Prompt prompt)
at TTS.<>c__DisplayClass3.<ProcessRequest>b__0()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, 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()
IIS_USRSにファイルC:\ Program Files(x86)\ Microsoft Speech SDK 5.1 \ Bin\TTSEng.dllへの完全なアクセス許可を与えました。エラーが次のように変更されました
An unhandled exception occurred and the process was terminated.
Application ID: /LM/W3SVC/17/ROOT
Process ID: 2816
Exception: System.InvalidOperationException
Message: No voice installed on the system or none available with the current security setting.
StackTrace: at System.Speech.Internal.Synthesis.VoiceSynthesis.Speak(Prompt prompt)
at System.Speech.Synthesis.SpeechSynthesizer.Speak(Prompt prompt)
at TTS.<>c__DisplayClass3.<ProcessRequest>b__0()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, 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)
サーバーにサウンドデバイスがありません。この例外は正しいですか?