AppleScript 和语音
是否可以使用 AppleScript 停止 Mac 当前正在生成(或已排队)的任何语音?
我基本上是在寻找与AppleScript“say”命令相反的命令。
Is it possible to stop any speech that the Mac is currently producing (or has queued) using an AppleScript?
I'm basically looking for the opposite of the AppleScript "say" command.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
试试这个,一个完整的 AppleScript 解决方案(不需要 shell):
Try this, a complete AppleScript solution (no shell required):
要停止演讲,您必须停止运行演讲的进程。当您说“Mac 当前正在生成的任何语音”时,这很难做到,因为可能有不同的进程生成语音。你必须找到一种方法来确定演讲的内容。
这是一个我生成语音的示例,因此我知道要终止哪个进程才能使语音停止。
To stop the speech you would have to stop the process running the speech. That's difficult to do when you say "any speech that the Mac is currently producing" because there could be different processes producing the speech. You'd have to figure out a way to determine what is producing the speech.
Here's an example where I generate the speech thus I know what process to kill to make the speech stop.