Я пытался заставить стрекозу работать на моем компьютере с Windows 10, но я могу только добиться активации NatLink.
Я настроил каталог пользователя в графическом интерфейсе NatLink, кака также активировал две опции отладки.
В моем пользовательском каталоге у меня есть один файл с именем grammar.py
:
from dragonfly import Grammar, CompoundRule
# Voice command rule combining spoken form and recognition processing.
class ExampleRule(CompoundRule):
spec = "do something computer" # Spoken form of command.
def _process_recognition(self, node, extras): # Callback when command is spoken.
print("Voice command spoken.")
# Create a grammar which contains and loads the command rule.
grammar = Grammar("example grammar") # Create a grammar to contain the command rule.
grammar.add_rule(ExampleRule()) # Add the command rule to the grammar.
grammar.load()
Ожидаемый результат заключается в том, что, когда я говорю "сделай что-нибудь компьютер"NatLink должен напечатать «Голосовая команда активирована» на своей консоли. Однако этого не происходит.
Когда я запускаю Dragon, консоль NatLink печатает следующее:
UserDirectory: C:\Users\bp\Documents\dragonfly-grammar
do extra output at (re)loading time: 1
do extra output at callback time: 1
-- natlinkmain starting...
NatLink pyd dir C:\Natlink\Natlink\MacroSystem\core
NatLink base dirC:\Natlink\Natlink\MacroSystem
userDirectory: C:\Users\bp\Documents\dragonfly-grammar
Unimacro not enabled
changeCallback, Type: user, args: ('bp', 'C:\\ProgramData\\Nuance\\NaturallySpeaking15\\Users\\bp\\current', 'US English', 'General - Large')
callback user, args: ('bp', 'C:\\ProgramData\\Nuance\\NaturallySpeaking15\\Users\\bp\\current', 'US English', 'General - Large')
---------changeCallback, User changed to bp
setting shiftkey to: {shift} (language: enx)
usercallback, language: enx
--- natlinkstartup starting...
vocolaEnabled: True
Loading _vocola_main
Vocola not active
Vocola is disabled...
filesToLoad: ['_vocola_main']
beginCallback, cbd: 0
check for changed files (all files)...
vocolaEnabled: 0
filesToLoad: []
vocolaEnabled: 0
filesToLoad: []
language: enx (<type 'str'>)
userLanguage: US English (<type 'str'>)
DNSuserDirectory: C:\ProgramData\Nuance\NaturallySpeaking15\Users\bp\current (<type 'str'>)
=== debugCallback info ===
natlinkmain changeCallback, global variable: coreDirectory: C:\Natlink\Natlink\MacroSystem\core
natlinkmain changeCallback, global variable: baseDirectory: C:\Natlink\Natlink\MacroSystem
natlinkmain changeCallback, global variable: DNSuserDirectory: C:\ProgramData\Nuance\NaturallySpeaking15\Users\bp\current
natlinkmain changeCallback, global variable: userName: bp
natlinkmain changeCallback, global variable: unimacroDirectory: C:\Natlink\Unimacro
natlinkmain changeCallback, global variable: userDirectory: C:\Users\bp\Documents\dragonfly-grammar
natlinkmain changeCallback, global variable: WindowsVersion: 10
natlinkmain changeCallback, global variable: BaseModel: US English | BestMatch IV
natlinkmain changeCallback, global variable: BaseTopic: US English | Large | General
natlinkmain changeCallback, global variable: language: enx
natlinkmain changeCallback, global variable: userLanguage: US English
natlinkmain changeCallback, global variable: userTopic: General - Large
vocolaEnabled: 0
filesToLoad: ['_vocola_main']
natlinkmain started from C:\Natlink\Natlink\MacroSystem\core:
NatLink version: 4.2
DNS version: 15
Python version: 27
Windows Version: 10
userDirectory: C:\Users\bp\Documents\dragonfly-grammar
baseDirectory: C:\Natlink\Natlink\MacroSystem
unimacroDirectory: C:\Natlink\Unimacro
natlinkmain imported-----------------------------------
Затем, когда я активирую микрофон, консоль NatLink печатает следующее:
changeCallback, Type: mic, args: on
findAndLoadFiles...
vocolaEnabled: 0
filesToLoad: ['_vocola_main']
beginCallback, cbd: 1
check for changed files (all files)...
vocolaEnabled: 0
filesToLoad: []
vocolaEnabled: 0
filesToLoad: []
=== debugCallback info ===
natlinkmain changeCallback, global variable: coreDirectory: C:\Natlink\Natlink\MacroSystem\core
natlinkmain changeCallback, global variable: baseDirectory: C:\Natlink\Natlink\MacroSystem
natlinkmain changeCallback, global variable: DNSuserDirectory: C:\ProgramData\Nuance\NaturallySpeaking15\Users\bp\current
natlinkmain changeCallback, global variable: userName: bp
natlinkmain changeCallback, global variable: unimacroDirectory: C:\Natlink\Unimacro
natlinkmain changeCallback, global variable: userDirectory: C:\Users\bp\Documents\dragonfly-grammar
natlinkmain changeCallback, global variable: WindowsVersion: 10
natlinkmain changeCallback, global variable: BaseModel: US English | BestMatch IV
natlinkmain changeCallback, global variable: BaseTopic: US English | Large | General
natlinkmain changeCallback, global variable: language: enx
natlinkmain changeCallback, global variable: userLanguage: US English
natlinkmain changeCallback, global variable: userTopic: General - Large
beginCallback, cbd: 1
check for changed files (only specific)
beginCallback, cbd: 1
check for changed files (only specific)
vocolaEnabled: 0
filesToLoad: []
changeCallback, Type: mic, args: off
Win10 64 бит, Python 2.7 32 бит