2015-10-19 50 views

回答

1
string threadMessage = null; 
    bool returnValue = true; 

    var t = new System.Threading.Thread(() => 
    { 
     try 
     { 
      SpeechEngine.SetOutputToWaveFile(wavFilePath); 
      SpeechEngine.Speak(text); 
      SpeechEngine.SetOutputToNull(); 
     } 
     catch (Exception exception) 
     { 
      threadMessage = "Error doing text to speech to file: " + exception.Message; 
      returnValue = false; 
     } 
    }); 
    t.Start(); 
    t.Join(); 

    if (!returnValue) 
    { 
     message = threadMessage; 
     return returnValue; 
    } 
+0

我可以得到充分的應用,如果你有嗎? – Shasvat

+0

我做了兩個月回來,現在我沒有完整的應用程序對不起的人。 – Ashokreddy

+0

沒問題,謝謝。 – Shasvat

相關問題