I want to use an event handler to stop speaking:
Speak[ExampleData[{"Text", "DonQuixoteISpanish"}]]
The only way I can stop this is by restarting mathematica!
|
Running
Using this with a text that is split into a list of shorter strings allows you to interrupt the audio at well-defined points, phrase breaks, say. Here is one way to do it:
You can now interrupt the computer in the usual way (Command. on Mac, Alt. on PC):
Now, of course, you do not get asynchronous speaking, so subsequent evaluations have to wait for the last phrase to be queued to execute. Note This solution was tested on version 8.04, and is reported not to work on version 7. |
|||||||||||||||
|
Speak["test test test"]; Print["hi"], it executes thePrintcommand before the first word is even spoken. – ian.milligan Aug 22 '12 at 20:21Quit[]won't have any effect because all of this is done by the FE (which is why you have to quit Mathematica to make it stop). I wonder if there is some hidden/undocumented token that can be used withFrontEndExecute... – rm -rf♦ Aug 22 '12 at 21:02ShutUp[]? – acl Aug 23 '12 at 17:44