C# 中 webControl 和 SAPI 的挂起问题
可能的重复:
SAPI 或(文本到语音)… C# 的同步问题
我用WebControl制作了一个浏览器。现在我想阅读并突出显示文本。所以我分割了 then 句子并开始循环。现在的问题是,通过同步调用 SAPI 来说出句子,浏览器的所有其他按钮都会停止工作。我无法暂停、恢复甚至退出该软件。每个按钮都被挂起。
如果我使用SAPI的异步调用,则不会出现此问题,但文本的突出显示将不起作用。因此,我需要坚持这个同步调用,并解决这个挂起问题。有谁有解决办法吗!!!!!!!
for (int i = 0; i < splitSentences.Length; i++)
{
highlight(splitSentences[i]);
sound_object.Speak(splitSentences[i]);
}
请紧急需要帮助。我怎样才能在说出句子时找出浏览器的暂停、退出按钮......
Possible Duplicate:
Synchronization Problem for SAPI or (text to speech ) … C#
I've made a browser with WebControl. Now I want to read and highlight the text. So I split then sentences and start a loop.now the problem is, with a Synchronous call of SAPI to speak the sentences, every other button of the browser stops working. I can't pause, resume or even exit the software. Every button get hanged.
If I use a asynchronous call of SAPI, this problem doesn't occur, but then the highlighting of text will not work. So, I need to stick with this Synchronous call and also get over with this hang problem. Does anyone have any solution!!!!!!!
for (int i = 0; i < splitSentences.Length; i++)
{
highlight(splitSentences[i]);
sound_object.Speak(splitSentences[i]);
}
Please urgent help needed. How can I work out those pause, exit buttons of browser while speaking the sentece....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为你应该在
HighLight
函数中使用 Invoke。例如,
I think you should use Invoke in
HighLight
function.For example,