使用Dragonfly禁用Windows语音识别

时间:2014-10-18 21:23:40

标签: python speech-recognition python-dragonfly

当我只想接受特定的Dragonfly命令时,是否可以禁用Windows语音识别(WSR)的某些方面?我正在使用内置的WSR和Dragonfly在Python中编写一个(简单的)语音控制交互系统。 WSR尝试在不理解命令时插入随机文本:

misheard command

如果可能的话,我想在Python / Dragonfly中以编程方式禁用此文本插入和其他不需要的内置插件(即具有默认WSR活动的关键字)。我的语音控制系统的一个最小功能示例如下:

from dragonfly.all import Grammar, CompoundRule
import dragonfly, time, pythoncom

hablador = dragonfly.get_engine()

class TimeRule(CompoundRule):
    spec = "what time is it"
    def _process_recognition(self, node, extras):
        hablador.speak(time.ctime()[11:16])

grammar = Grammar("example grammar")
grammar.add_rule(TimeRule())
grammar.load()

while True:
    pythoncom.PumpWaitingMessages()
    time.sleep(.1)

2 个答案:

答案 0 :(得分:2)

您可以禁用听写暂存器,但不能在Python中禁用。来自Microsoft help article

  

说“显示语音选项”,说“选项”,然后说“启用”   听写暂记簿。“

命令是相同的,以便禁用它。至于覆盖或禁用内置组件,我不相信这是可能的。

答案 1 :(得分:-1)

为什么不添加一个匹配所有内容的规则并丢弃其输入?