如何使用 Python 模块 Dragonfly 识别语音?
我一直在试图弄清楚如何使用 Dragonfly 模块。我查看了文档,但似乎不知道如何使用它。我只想能够识别一些短语并根据这些短语采取行动。
I have been trying to figure out how to use the Dragonfly module. I have taken a look at the documentation, but I can't seem to figure out how to use it. I just want to be able to recognize a few phrases and act upon those phrases.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是的,这个例子将终止。我已经看过这个特定的例子很多了,它缺少一些关键功能。
首先是 pythoncom 没有导入。这为程序提供了一个主循环。以上
That's correct, this example will terminate. I've seen this particular example quite a bit, and it is missing a number of key features.
The first thing is that pythoncom is not imported. This provides a main loop for the program. The above
首先,如果您使用的是 Linux,您应该知道 Dragonfly 仅适用于 Windows 语音识别或 Dragon NaturallySpeaking + Natlink。 (可以使用虚拟机和 Aenea 在 Linux 上运行,但这似乎是不可能的这个问题的范围。)
如果您将它与 WSR 一起使用,那么它应该像确保 Dragonfly 位于您的 Python 路径中并在主脚本末尾调用以下内容一样简单:
如果您正在使用它对于 Dragon NaturallySpeaking,请点击上面的链接访问 Natlink 网站,并按照其中的说明安装并激活 Natlink,然后再尝试使用 Dragonfly。安装后(使用所有默认值),您应该能够将 Dragonfly 脚本放入 C:\NatLink\NatLink\MacroSystem 文件夹中,并在启动 Dragon NaturallySpeaking 时自动激活它们。
First, in case you're using Linux, you should know that Dragonfly only works with Windows Speech Recognition or Dragon NaturallySpeaking + Natlink. (It is possible to get it working on Linux with a virtual machine and Aenea, but that seems out of the scope of this question.)
If you're using it with WSR, it should be as simple as making sure that Dragonfly is in your Python path and calling the following at the end of your main script:
If you're using it with Dragon NaturallySpeaking, follow the link above to the Natlink website and follow the instructions there to install and activate Natlink before trying to use Dragonfly. Once it is installed (use all the defaults), you should be able to put Dragonfly scripts in your C:\NatLink\NatLink\MacroSystem folder and have them activate automatically when you start Dragon NaturallySpeaking.
我发现本文档中给出的用法示例是非常简单且不言自明:
I find the usage example given in this document to be pretty simple and self-explaining: