我有一个System.Speech.Sythesis问题。 [英] I have a System.Speech.Sythesis issue.

查看:95
本文介绍了我有一个System.Speech.Sythesis问题。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Visual Basic 2010.如何防止System.Speech.Synthesis在运行时冻结所有表单控件?

单击命令按钮运行程序的TTS部分后,其他一切都停止运行。我有一个同时运行的计时器,将三个图像循环到一个图片盒中,该图片盒完全停止,直到语音完成。表单上的每个控件都会发生相同的情况,包括所有命令按钮。

我真的很感激你们可以提供的任何帮助。

Visual basic 2010. How to prevent System.Speech.Synthesis from freezing all form controls when operating?
Once the command button is clicked to run the TTS part of my program, everything else stops running. I have a timer running simultaneously to cycle three images into a picturebox, which stops completely until the speech has completed. The same happens to each of the controls on the form, including all command buttons.
I would really appreciate any help you guys can provide.

推荐答案

在单独的线程中进行综合,而不是UI线程。请记住,应该在一个线程中执行此API的所有使用。



使用通常的线程间通信/同步原语将UI与此线程同步。



-SA
Do the synthesis in a separate thread, not UI thread. Remember that all the use of this API should be performed in one single thread.

Synchronize UI with this thread using usual inter-thread communication/synchronization primitives.

—SA


这篇关于我有一个System.Speech.Sythesis问题。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆