1

Is it possible to disable certain aspects of Windows Speech Recognition (WSR) when I only wish to accept specific Dragonfly commands? I am programming a (simple) voice-controlled interaction system in Python using built-in WSR and Dragonfly. WSR attempts to insert random text whenever it doesn't understand a command:

misheard command

I would like to disable this text insertion and other undesired built-ins (i.e. keywords with default WSR activity) programmatically within Python/Dragonfly, if possible. A minimal, functional example of my voice-control system is below:

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)
Nikolay Shmyrev
  • 24,897
  • 5
  • 43
  • 87
Luigi
  • 4,129
  • 6
  • 37
  • 57
  • I'm not familiar with dragonfly, but maybe you could get more help with this if you gave some example input, the current (buggy) output, and the desired output. – ArtOfWarfare Oct 27 '14 at 18:50
  • I just want to disable the WSR built-in typing feature and the WSR keywords ("close", etc.) using dragonfly – Luigi Oct 28 '14 at 15:48
  • Fyi, you can run your python dragonfly scripts without WSR listening, or off completely. Maybe overkill for you. – Charles J. Daniels Feb 05 '15 at 05:03

2 Answers2

2

You can disable the dictation scratchpad, but not from within Python. From the Microsoft help article:

Say "show Speech Options," say "Options," and then say "Enable dictation scratchpad."

The commands are the same in order to disable it. As for overriding or disabling the builtins, I do not believe this is possible.

synkarius
  • 324
  • 1
  • 8
-1

Why not just add a rule that matches everything and discards its input?

Kevin
  • 28,963
  • 9
  • 62
  • 81
  • This isn't really feasible, and also doesn't address the builtins, which override anything I add using dragonfly – Luigi Oct 29 '14 at 01:01