2

テキスト読み上げ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)

サーバーにサウンドデバイスがありません。この例外は正しいですか?

4

3 に答える 3

2

フォローしてみてください

  1. IISは実行されていますか
  2. 実行中のデフォルトのWebサイト
  3. アプリプールとASP.Netバージョン
  4. アクセスは適切です
于 2013-01-11T20:49:42.413 に答える
0

zahidはここで正しい答えを持っています。IISで、[アプリケーションプール]を選択し、[詳細設定]をクリックして、[IDの種類]を選択します。

音声はユーザーレベルでデータにアクセスする必要があります。

于 2013-11-06T05:22:30.953 に答える
0

C:\windows\system32\config\systemprofile\appdata\roamingアプリプールが実行されているのと同じユーザーに読み取り/書き込みアクセスを許可してみてください。

于 2014-02-20T14:53:20.967 に答える