Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>In a comment below you mention the library you are using and that changes this whole answer.</p> <p><strong>Answer to your problem:</strong><br> In your case since you are using the SAPI.SpVoice library you don't need to do any work related to spinning up background threads and such since that object support asynchronous playback. Check out the arguments of the Speak method. Here is the documentation: <a href="http://msdn.microsoft.com/en-us/library/ms723609(v=vs.85).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms723609(v=vs.85).aspx</a></p> <p><strong>Answer to your question as it is posed:</strong><br> The simplest method is to use a background worker process to run some code. This will allow your program to run some long process and not block the UI thread. The background worker even provides events to notify your UI thread of it's progress. </p> <p>Here is an link to MSDN <a href="http://msdn.microsoft.com/en-us/library/cc221403(v=vs.95).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/cc221403(v=vs.95).aspx</a></p> <p>The background worker is a simple way to spin off some work onto another thread, there are other tools for more complex scenarios. In essence you create an instance of a background worker object and add your long-running code to a function that is created to handle it's DoWork event. There are ProgressChanged and RunWorkerCompleted events that should be handled as well. There are methods that can be called to cancel the process. The MSDN link above provides a couple of good complete code examples.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload