我正在嘗試使用SpeakAsync()方法講一些文本。但是,直到我打電話說Speak()之前,它纔開始說話。我不想打電話說()。如果我從這個代碼沒有刪除說話()方法被調用都:SpeechSynthesizer.SpeakAsync方法不立即講
using (SpeechSynthesizer synth = new SpeechSynthesizer())
{
synth.SelectVoice("ScanSoft Emily_Dri20_22kHz");
synth.Rate = 10;
synth.Volume = 100;
synth.SpeakAsync("oh, i'm a lumberjack and i'm okay! I sleep all night and I work all day!");
synth.SpeakAsync("If he was dying he wouldn't bother writing ah! He'd just say it!");
synth.Speak("i don't want to go on the cart.");
synth.SpeakAsync("We don't have a lord. We're an anarcho-syndicalist commune.");
synth.SpeakAsync("If you do not show us the grail, we shall take your castle by force!");
synth.Speak("what do you mean, an african swallow or a european swallow?");
UPDATE:
看來其他人有這個問題,但沒有解決辦法尚未找到:
other people having this problem
這是一個控制檯應用程序? – keyboardP 2013-04-04 11:41:32
是的。這是一個控制檯應用程序。我從MSDN複製粘貼了一些示例代碼,然後試圖擴展它。 – gonzobrains 2013-04-04 11:43:28