如何知道SpeakTextAsync何时完成? [英] How to know when SpeakTextAsync is completed?
本文介绍了如何知道SpeakTextAsync何时完成?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
怎么知道SpeakTextAsync什么时候完成?我有一个应用程序,它会说一些文本,然后需要提示回复。我怎么知道SpeechSynthesizer何时完成?
-matt
解决方案
如果您使用 等待 运算符,则在语音完成后才会返回。
await synthesizer.SpeakTextAsync(" speech text");
//演讲结束
Hi Everyone,
how does one know when SpeakTextAsync is done? I have an app where it speaks some text, then need to prompt for a response. How do I know when the the SpeechSynthesizer has completed?
-matt
解决方案
If you use the await operator, it doesn't return until after the speech is completed.
await synthesizer.SpeakTextAsync("speech text"); // speech is completed
这篇关于如何知道SpeakTextAsync何时完成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文