dictation-toolbox / dragonfly

Speech recognition framework allowing powerful Python-based scripting and extension of Dragon NaturallySpeaking (DNS), Windows Speech Recognition (WSR), Kaldi and CMU Pocket Sphinx
GNU Lesser General Public License v3.0
388 stars 75 forks source link

MacOS No keyboard control #344

Closed Timoses closed 3 years ago

Timoses commented 3 years ago

Since some time keyboard input/control does not work any more (e.g. Caster dictation).

Dragonfly recognizes the command, but does not type anything.

Here's the log:

DEBUG:grammar.begin:Grammar Git: detected beginning of utterance.
DEBUG:grammar.begin:Grammar Git: executable 'alacritty', title ''.
DEBUG:context.match:AppContext(['alacritty'], None, False): Match.
DEBUG:grammar.begin:Grammar Git:     active rules: ['GitRule'].
DEBUG:grammar.begin:Grammar Tmux: detected beginning of utterance.
DEBUG:grammar.begin:Grammar Tmux: executable 'alacritty', title ''.
DEBUG:context.match:AppContext(['alacritty'], None, False): Match.
DEBUG:grammar.begin:Grammar Tmux:     active rules: ['TmuxRule', '_IntegerRef_15'].
DEBUG:grammar.begin:Grammar casterplugin.bringme.BringMe: detected beginning of utterance.
DEBUG:grammar.begin:Grammar casterplugin.bringme.BringMe: executable 'alacritty', title ''.
DEBUG:grammar.begin:Grammar casterplugin.bringme.BringMe:     active rules: ['BringMeProgram'].
DEBUG:grammar.begin:Grammar Git: detected beginning of utterance.
DEBUG:grammar.begin:Grammar Git: executable 'alacritty', title ''.
DEBUG:context.match:AppContext(['firefox'], None, False): No match, executable doesn't match.
DEBUG:grammar.load:Grammar Git: deactivating rule FirefoxRule.
DEBUG:engine:Deactivating rule FirefoxRule in grammar Git.
DEBUG:grammar.load:Grammar Git: deactivating rule _IntegerRef_13.
DEBUG:grammar.begin:Grammar Git:     active rules: [].
DEBUG:grammar.begin:Grammar casterplugin.dictation.DictationPlugin: detected beginning of utterance.
DEBUG:grammar.begin:Grammar casterplugin.dictation.DictationPlugin: executable 'alacritty', title ''.
DEBUG:grammar.begin:Grammar casterplugin.dictation.DictationPlugin:     active rules: ['CCR_Alphabet_Punctuation_Control_Format', 'Alphabet', 'Punctuation', '_IntegerRef_11', '_IntegerRef_12', 'Control', '_IntegerRef_09', '_IntegerRef_07', '_IntegerRef_10', 'Format'].
DEBUG:grammar.begin:Grammar Control: detected beginning of utterance.
DEBUG:grammar.begin:Grammar Control: executable 'alacritty', title ''.
DEBUG:grammar.begin:Grammar Control:     active rules: ['ControlRule'].
DEBUG:engine:active kaldi_rules (from window {'executable': 'alacritty', 'title': '', 'handle': 565386}): ['casterplugin.dictation.DictationPlugin::CCR_Alphabet_Punctuation_Control_Format', 'casterplugin.dictation.DictationPlugin::Format', 'casterplugin.dictation.DictationPlugin::Alphabet', 'Git::GitRule', 'casterplugin.bringme.BringMe::BringMeProgram', 'Tmux::TmuxRule', 'casterplugin.dictation.DictationPlugin::Control', 'Control::ControlRule', 'casterplugin.dictation.DictationPlugin::Punctuation']
DEBUG:engine:computing activity 548 ms
Level 15:kaldi.wrapper:decoded at 0.14 RTF, for 990 ms audio, spending 138 ms, of which 50 ms (37%) in finalization
Level 13:kaldi.wrapper:    decode times: 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 19 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 37 50
DEBUG:kaldi.compiler:parse_output('#nonterm:rule5 say #nonterm:dictation hello #nonterm:end #nonterm:end')
Level 12:engine:Alignment (word,time,length): (('#nonterm:rule5', 0, 0), ('say', 1920, 7680), ('#nonterm:dictation', 9600, 0), ('hello', 9600, 11520), ('#nonterm:end', 21120, 0), ('#nonterm:end', 21120, 0))
DEBUG:grammar.decode:   attempt: Format(Format)
DEBUG:grammar.decode:    -- Decoding State: ' >> say hello'
DEBUG:grammar.decode:      attempt: Alternative(...)
DEBUG:grammar.decode:         attempt: Compound('set [<big>] format (<capitalization> <spacing> | <capitalization> | <spacing>) [(bow|bowel)]')
DEBUG:grammar.decode:            attempt: Sequence(...)
DEBUG:grammar.decode:               attempt: Literal(['set'])
DEBUG:grammar.decode:               failure: Literal(['set'])
DEBUG:grammar.decode:            failure: Sequence(...)
DEBUG:grammar.decode:         rollback: Compound('set [<big>] format (<capitalization> <spacing> | <capitalization> | <spacing>) [(bow|bowel)]')
DEBUG:grammar.decode:         failure: Compound('set [<big>] format (<capitalization> <spacing> | <capitalization> | <spacing>) [(bow|bowel)]')
DEBUG:grammar.decode:      rollback: Alternative(...)
DEBUG:grammar.decode:         attempt: Compound('clear castervoice [<big>] formatting')
DEBUG:grammar.decode:            attempt: Sequence(...)
DEBUG:grammar.decode:               attempt: Literal(['clear', 'castervoice'])
DEBUG:grammar.decode:               failure: Literal(['clear', 'castervoice'])
DEBUG:grammar.decode:            failure: Sequence(...)
DEBUG:grammar.decode:         rollback: Compound('clear castervoice [<big>] formatting')
DEBUG:grammar.decode:         failure: Compound('clear castervoice [<big>] formatting')
DEBUG:grammar.decode:      rollback: Alternative(...)
DEBUG:grammar.decode:         attempt: Compound('peek [<big>] format')
DEBUG:grammar.decode:            attempt: Sequence(...)
DEBUG:grammar.decode:               attempt: Literal(['peek'])
DEBUG:grammar.decode:               failure: Literal(['peek'])
DEBUG:grammar.decode:            failure: Sequence(...)
DEBUG:grammar.decode:         rollback: Compound('peek [<big>] format')
DEBUG:grammar.decode:         failure: Compound('peek [<big>] format')
DEBUG:grammar.decode:      rollback: Alternative(...)
DEBUG:grammar.decode:         attempt: Compound('(<capitalization> <spacing> | <capitalization> | <spacing>) [(bow|bowel)] <textnv> [brunt]')
DEBUG:grammar.decode:            attempt: Sequence(...)
DEBUG:grammar.decode:               attempt: Alternative(...)
DEBUG:grammar.decode:                  attempt: Sequence(...)
DEBUG:grammar.decode:                     attempt: Choice(..., name='capitalization')
DEBUG:grammar.decode:                        attempt: Compound('yell')
DEBUG:grammar.decode:                           attempt: Literal(['yell'])
DEBUG:grammar.decode:                           failure: Literal(['yell'])
DEBUG:grammar.decode:                        rollback: Compound('yell')
DEBUG:grammar.decode:                        failure: Compound('yell')
DEBUG:grammar.decode:                     rollback: Choice(..., name='capitalization')
DEBUG:grammar.decode:                        attempt: Compound('tie')
DEBUG:grammar.decode:                           attempt: Literal(['tie'])
DEBUG:grammar.decode:                           failure: Literal(['tie'])
DEBUG:grammar.decode:                        rollback: Compound('tie')
DEBUG:grammar.decode:                        failure: Compound('tie')
DEBUG:grammar.decode:                     rollback: Choice(..., name='capitalization')
DEBUG:grammar.decode:                        attempt: Compound('gerrish')
DEBUG:grammar.decode:                           attempt: Literal(['gerrish'])
DEBUG:grammar.decode:                           failure: Literal(['gerrish'])
DEBUG:grammar.decode:                        rollback: Compound('gerrish')
DEBUG:grammar.decode:                        failure: Compound('gerrish')
DEBUG:grammar.decode:                     rollback: Choice(..., name='capitalization')
DEBUG:grammar.decode:                        attempt: Compound('sing')
DEBUG:grammar.decode:                           attempt: Literal(['sing'])
DEBUG:grammar.decode:                           failure: Literal(['sing'])
DEBUG:grammar.decode:                        rollback: Compound('sing')
DEBUG:grammar.decode:                        failure: Compound('sing')
DEBUG:grammar.decode:                     rollback: Choice(..., name='capitalization')
DEBUG:grammar.decode:                        attempt: Compound('laws')
DEBUG:grammar.decode:                           attempt: Literal(['laws'])
DEBUG:grammar.decode:                           failure: Literal(['laws'])
DEBUG:grammar.decode:                        rollback: Compound('laws')
DEBUG:grammar.decode:                        failure: Compound('laws')
DEBUG:grammar.decode:                     rollback: Choice(..., name='capitalization')
DEBUG:grammar.decode:                        attempt: Compound('say')
DEBUG:grammar.decode:                           attempt: Literal(['say'])
DEBUG:grammar.decode:                           success: Literal(['say'])
DEBUG:grammar.decode:                            -- Decoding State: 'say >> hello'
DEBUG:grammar.decode:                        success: Compound('say')
DEBUG:grammar.decode:                     success: Choice(..., name='capitalization')
DEBUG:grammar.decode:                     attempt: Choice(..., name='spacing')
DEBUG:grammar.decode:                        attempt: Compound('gum')
DEBUG:grammar.decode:                           attempt: Literal(['gum'])
DEBUG:grammar.decode:                           failure: Literal(['gum'])
DEBUG:grammar.decode:                        rollback: Compound('gum')
DEBUG:grammar.decode:                        failure: Compound('gum')
DEBUG:grammar.decode:                     rollback: Choice(..., name='spacing')
DEBUG:grammar.decode:                        attempt: Compound('gun')
DEBUG:grammar.decode:                           attempt: Literal(['gun'])
DEBUG:grammar.decode:                           failure: Literal(['gun'])
DEBUG:grammar.decode:                        rollback: Compound('gun')
DEBUG:grammar.decode:                        failure: Compound('gun')
DEBUG:grammar.decode:                     rollback: Choice(..., name='spacing')
DEBUG:grammar.decode:                        attempt: Compound('spine')
DEBUG:grammar.decode:                           attempt: Literal(['spine'])
DEBUG:grammar.decode:                           failure: Literal(['spine'])
DEBUG:grammar.decode:                        rollback: Compound('spine')
DEBUG:grammar.decode:                        failure: Compound('spine')
DEBUG:grammar.decode:                     rollback: Choice(..., name='spacing')
DEBUG:grammar.decode:                        attempt: Compound('snake')
DEBUG:grammar.decode:                           attempt: Literal(['snake'])
DEBUG:grammar.decode:                           failure: Literal(['snake'])
DEBUG:grammar.decode:                        rollback: Compound('snake')
DEBUG:grammar.decode:                        failure: Compound('snake')
DEBUG:grammar.decode:                     rollback: Choice(..., name='spacing')
DEBUG:grammar.decode:                        attempt: Compound('pebble')
DEBUG:grammar.decode:                           attempt: Literal(['pebble'])
DEBUG:grammar.decode:                           failure: Literal(['pebble'])
DEBUG:grammar.decode:                        rollback: Compound('pebble')
DEBUG:grammar.decode:                        failure: Compound('pebble')
DEBUG:grammar.decode:                     rollback: Choice(..., name='spacing')
DEBUG:grammar.decode:                        attempt: Compound('incline')
DEBUG:grammar.decode:                           attempt: Literal(['incline'])
DEBUG:grammar.decode:                           failure: Literal(['incline'])
DEBUG:grammar.decode:                        rollback: Compound('incline')
DEBUG:grammar.decode:                        failure: Compound('incline')
DEBUG:grammar.decode:                     rollback: Choice(..., name='spacing')
DEBUG:grammar.decode:                        attempt: Compound('dissent')
DEBUG:grammar.decode:                           attempt: Literal(['dissent'])
DEBUG:grammar.decode:                           failure: Literal(['dissent'])
DEBUG:grammar.decode:                        rollback: Compound('dissent')
DEBUG:grammar.decode:                        failure: Compound('dissent')
DEBUG:grammar.decode:                     rollback: Choice(..., name='spacing')
DEBUG:grammar.decode:                        attempt: Compound('descent')
DEBUG:grammar.decode:                           attempt: Literal(['descent'])
DEBUG:grammar.decode:                           failure: Literal(['descent'])
DEBUG:grammar.decode:                        rollback: Compound('descent')
DEBUG:grammar.decode:                        failure: Compound('descent')
DEBUG:grammar.decode:                     rollback: Choice(..., name='spacing')
DEBUG:grammar.decode:                     failure: Choice(..., name='spacing')
DEBUG:grammar.decode:                     retry: Choice(..., name='capitalization')
DEBUG:grammar.decode:                        retry: Compound('say')
DEBUG:grammar.decode:                           retry: Literal(['say'])
DEBUG:grammar.decode:                           failure: Literal(['say'])
DEBUG:grammar.decode:                            -- Decoding State: ' >> say hello'
DEBUG:grammar.decode:                        rollback: Compound('say')
DEBUG:grammar.decode:                        failure: Compound('say')
DEBUG:grammar.decode:                     rollback: Choice(..., name='capitalization')
DEBUG:grammar.decode:                        attempt: Compound('cop')
DEBUG:grammar.decode:                           attempt: Literal(['cop'])
DEBUG:grammar.decode:                           failure: Literal(['cop'])
DEBUG:grammar.decode:                        rollback: Compound('cop')
DEBUG:grammar.decode:                        failure: Compound('cop')
DEBUG:grammar.decode:                     rollback: Choice(..., name='capitalization')
DEBUG:grammar.decode:                        attempt: Compound('slip')
DEBUG:grammar.decode:                           attempt: Literal(['slip'])
DEBUG:grammar.decode:                           failure: Literal(['slip'])
DEBUG:grammar.decode:                        rollback: Compound('slip')
DEBUG:grammar.decode:                        failure: Compound('slip')
DEBUG:grammar.decode:                     rollback: Choice(..., name='capitalization')
DEBUG:grammar.decode:                     failure: Choice(..., name='capitalization')
DEBUG:grammar.decode:                  failure: Sequence(...)
DEBUG:grammar.decode:               rollback: Alternative(...)
DEBUG:grammar.decode:                  attempt: Choice(..., name='capitalization')
DEBUG:grammar.decode:                     attempt: Compound('yell')
DEBUG:grammar.decode:                        attempt: Literal(['yell'])
DEBUG:grammar.decode:                        failure: Literal(['yell'])
DEBUG:grammar.decode:                     rollback: Compound('yell')
DEBUG:grammar.decode:                     failure: Compound('yell')
DEBUG:grammar.decode:                  rollback: Choice(..., name='capitalization')
DEBUG:grammar.decode:                     attempt: Compound('tie')
DEBUG:grammar.decode:                        attempt: Literal(['tie'])
DEBUG:grammar.decode:                        failure: Literal(['tie'])
DEBUG:grammar.decode:                     rollback: Compound('tie')
DEBUG:grammar.decode:                     failure: Compound('tie')
DEBUG:grammar.decode:                  rollback: Choice(..., name='capitalization')
DEBUG:grammar.decode:                     attempt: Compound('gerrish')
DEBUG:grammar.decode:                        attempt: Literal(['gerrish'])
DEBUG:grammar.decode:                        failure: Literal(['gerrish'])
DEBUG:grammar.decode:                     rollback: Compound('gerrish')
DEBUG:grammar.decode:                     failure: Compound('gerrish')
DEBUG:grammar.decode:                  rollback: Choice(..., name='capitalization')
DEBUG:grammar.decode:                     attempt: Compound('sing')
DEBUG:grammar.decode:                        attempt: Literal(['sing'])
DEBUG:grammar.decode:                        failure: Literal(['sing'])
DEBUG:grammar.decode:                     rollback: Compound('sing')
DEBUG:grammar.decode:                     failure: Compound('sing')
DEBUG:grammar.decode:                  rollback: Choice(..., name='capitalization')
DEBUG:grammar.decode:                     attempt: Compound('laws')
DEBUG:grammar.decode:                        attempt: Literal(['laws'])
DEBUG:grammar.decode:                        failure: Literal(['laws'])
DEBUG:grammar.decode:                     rollback: Compound('laws')
DEBUG:grammar.decode:                     failure: Compound('laws')
DEBUG:grammar.decode:                  rollback: Choice(..., name='capitalization')
DEBUG:grammar.decode:                     attempt: Compound('say')
DEBUG:grammar.decode:                        attempt: Literal(['say'])
DEBUG:grammar.decode:                        success: Literal(['say'])
DEBUG:grammar.decode:                         -- Decoding State: 'say >> hello'
DEBUG:grammar.decode:                     success: Compound('say')
DEBUG:grammar.decode:                  success: Choice(..., name='capitalization')
DEBUG:grammar.decode:               success: Alternative(...)
DEBUG:grammar.decode:               attempt: Optional(...)
DEBUG:grammar.decode:                  attempt: Alternative(...)
DEBUG:grammar.decode:                     attempt: Literal(['bow'])
DEBUG:grammar.decode:                     failure: Literal(['bow'])
DEBUG:grammar.decode:                  rollback: Alternative(...)
DEBUG:grammar.decode:                     attempt: Literal(['bowel'])
DEBUG:grammar.decode:                     failure: Literal(['bowel'])
DEBUG:grammar.decode:                  rollback: Alternative(...)
DEBUG:grammar.decode:                  failure: Alternative(...)
DEBUG:grammar.decode:               rollback: Optional(...)
DEBUG:grammar.decode:               success: Optional(...)
DEBUG:grammar.decode:               attempt: Dictation('textnv')
DEBUG:grammar.decode:               success: Dictation('textnv')
DEBUG:grammar.decode:                -- Decoding State: 'say hello >> '
DEBUG:grammar.decode:               attempt: Optional(...)
DEBUG:grammar.decode:                  attempt: Literal(['brunt'])
DEBUG:grammar.decode:                  failure: Literal(['brunt'])
DEBUG:grammar.decode:               rollback: Optional(...)
DEBUG:grammar.decode:               success: Optional(...)
DEBUG:grammar.decode:            success: Sequence(...)
DEBUG:grammar.decode:         success: Compound('(<capitalization> <spacing> | <capitalization> | <spacing>) [(bow|bowel)] <textnv> [brunt]')
DEBUG:grammar.decode:      success: Alternative(...)
DEBUG:grammar.decode:   success: Format(Format)
DEBUG:action.exec:Executing action: 'master_format_text'() ({'_grammar': Grammar(casterplugin.dictation.DictationPlugin), '_rule': Format(Format), '_node': Node: Alternative(...), ['say', 'hello'], 'big': False, 'capitalization': 6, 'spacing': 0, 'textnv': DictationContainerBase(hello)})
DEBUG:action.exec:Executing action: 'hello' (None)
DEBUG:keyboard:Keyboard.send_keyboard_events [('h', True, 0), ('h', False, 0.005), ('e', True, 0), ('e', False, 0.005), ('l', True, 0), ('l', False, 0.005), ('l', True, 0), ('l', False, 0.005), ('o', True, 0), ('o', False, 0.005)]
DEBUG:engine:rule execution time 36 ms
DEBUG:engine:dragonfly parse time 9 ms
Level 15:engine:End of phrase: eer=0.00 conf=nan, rule KaldiRule(5, casterplugin.dictation.DictationPlugin::Format), 'say hello'
DEBUG:grammar.begin:Grammar Git: detected beginning of utterance.
DEBUG:grammar.begin:Grammar Git: executable 'alacritty', title ''.
DEBUG:context.match:AppContext(['alacritty'], None, False): Match.
DEBUG:grammar.begin:Grammar Git:     active rules: ['GitRule'].
DEBUG:grammar.begin:Grammar Tmux: detected beginning of utterance.
DEBUG:grammar.begin:Grammar Tmux: executable 'alacritty', title ''.
DEBUG:context.match:AppContext(['alacritty'], None, False): Match.
DEBUG:grammar.begin:Grammar Tmux:     active rules: ['TmuxRule', '_IntegerRef_15'].
DEBUG:grammar.begin:Grammar casterplugin.bringme.BringMe: detected beginning of utterance.
DEBUG:grammar.begin:Grammar casterplugin.bringme.BringMe: executable 'alacritty', title ''.
DEBUG:grammar.begin:Grammar casterplugin.bringme.BringMe:     active rules: ['BringMeProgram'].
DEBUG:grammar.begin:Grammar Git: detected beginning of utterance.
DEBUG:grammar.begin:Grammar Git: executable 'alacritty', title ''.
DEBUG:context.match:AppContext(['firefox'], None, False): No match, executable doesn't match.
DEBUG:grammar.begin:Grammar Git:     active rules: [].
DEBUG:grammar.begin:Grammar casterplugin.dictation.DictationPlugin: detected beginning of utterance.
DEBUG:grammar.begin:Grammar casterplugin.dictation.DictationPlugin: executable 'alacritty', title ''.
DEBUG:grammar.begin:Grammar casterplugin.dictation.DictationPlugin:     active rules: ['CCR_Alphabet_Punctuation_Control_Format', 'Alphabet', 'Punctuation', '_IntegerRef_11', '_IntegerRef_12', 'Control', '_IntegerRef_09', '_IntegerRef_07', '_IntegerRef_10', 'Format'].
DEBUG:grammar.begin:Grammar Control: detected beginning of utterance.
DEBUG:grammar.begin:Grammar Control: executable 'alacritty', title ''.
DEBUG:grammar.begin:Grammar Control:     active rules: ['ControlRule'].
DEBUG:engine:active kaldi_rules (from window {'executable': 'alacritty', 'title': '', 'handle': 565386}): ['casterplugin.dictation.DictationPlugin::CCR_Alphabet_Punctuation_Control_Format', 'casterplugin.dictation.DictationPlugin::Format', 'casterplugin.dictation.DictationPlugin::Alphabet', 'Git::GitRule', 'casterplugin.bringme.BringMe::BringMeProgram', 'Tmux::TmuxRule', 'casterplugin.dictation.DictationPlugin::Control', 'Control::ControlRule', 'casterplugin.dictation.DictationPlugin::Punctuation']
DEBUG:engine:computing activity 165 ms
Level 15:kaldi.wrapper:decoded at 0.10 RTF, for 720 ms audio, spending 68 ms, of which 40 ms (60%) in finalization
Level 13:kaldi.wrapper:    decode times: 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 40
DEBUG:kaldi.compiler:parse_output('#nonterm:rule1 #nonterm:end')
Level 12:engine:Alignment (word,time,length): (('#nonterm:rule1', 0, 0), ('#nonterm:end', 0, 0))
Level 15:engine:End of phrase: eer=0.02 conf=nan [BAD], rule None, ''
DEBUG:grammar.begin:Grammar Git: detected beginning of utterance.
DEBUG:grammar.begin:Grammar Git: executable 'alacritty', title ''.
DEBUG:context.match:AppContext(['alacritty'], None, False): Match.
DEBUG:grammar.begin:Grammar Git:     active rules: ['GitRule'].
DEBUG:grammar.begin:Grammar Tmux: detected beginning of utterance.
DEBUG:grammar.begin:Grammar Tmux: executable 'alacritty', title ''.
DEBUG:context.match:AppContext(['alacritty'], None, False): Match.
DEBUG:grammar.begin:Grammar Tmux:     active rules: ['TmuxRule', '_IntegerRef_15'].
DEBUG:grammar.begin:Grammar casterplugin.bringme.BringMe: detected beginning of utterance.
DEBUG:grammar.begin:Grammar casterplugin.bringme.BringMe: executable 'alacritty', title ''.
DEBUG:grammar.begin:Grammar casterplugin.bringme.BringMe:     active rules: ['BringMeProgram'].
DEBUG:grammar.begin:Grammar Git: detected beginning of utterance.
DEBUG:grammar.begin:Grammar Git: executable 'alacritty', title ''.
DEBUG:context.match:AppContext(['firefox'], None, False): No match, executable doesn't match.
DEBUG:grammar.begin:Grammar Git:     active rules: [].
DEBUG:grammar.begin:Grammar casterplugin.dictation.DictationPlugin: detected beginning of utterance.
DEBUG:grammar.begin:Grammar casterplugin.dictation.DictationPlugin: executable 'alacritty', title ''.
DEBUG:grammar.begin:Grammar casterplugin.dictation.DictationPlugin:     active rules: ['CCR_Alphabet_Punctuation_Control_Format', 'Alphabet', 'Punctuation', '_IntegerRef_11', '_IntegerRef_12', 'Control', '_IntegerRef_09', '_IntegerRef_07', '_IntegerRef_10', 'Format'].
DEBUG:grammar.begin:Grammar Control: detected beginning of utterance.
DEBUG:grammar.begin:Grammar Control: executable 'alacritty', title ''.
DEBUG:grammar.begin:Grammar Control:     active rules: ['ControlRule'].
DEBUG:engine:active kaldi_rules (from window {'executable': 'alacritty', 'title': '', 'handle': 565386}): ['casterplugin.dictation.DictationPlugin::CCR_Alphabet_Punctuation_Control_Format', 'casterplugin.dictation.DictationPlugin::Format', 'casterplugin.dictation.DictationPlugin::Alphabet', 'Git::GitRule', 'casterplugin.bringme.BringMe::BringMeProgram', 'Tmux::TmuxRule', 'casterplugin.dictation.DictationPlugin::Control', 'Control::ControlRule', 'casterplugin.dictation.DictationPlugin::Punctuation']
DEBUG:engine:computing activity 164 ms
Level 15:kaldi.wrapper:decoded at 0.10 RTF, for 1050 ms audio, spending 108 ms, of which 37 ms (35%) in finalization
Level 13:kaldi.wrapper:    decode times: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 19 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 17 0 0 0 0 0 0 37
DEBUG:kaldi.compiler:parse_output('#nonterm:rule1 #nonterm:end')
Level 12:engine:Alignment (word,time,length): (('#nonterm:rule1', 0, 0), ('#nonterm:end', 0, 0))
Level 15:engine:End of phrase: eer=0.02 conf=nan [BAD], rule None, ''
DEBUG:grammar.begin:Grammar Git: detected beginning of utterance.
DEBUG:grammar.begin:Grammar Git: executable 'TextEdit', title ''.
DEBUG:context.match:AppContext(['alacritty'], None, False): No match, executable doesn't match.
DEBUG:grammar.load:Grammar Git: deactivating rule GitRule.
DEBUG:engine:Deactivating rule GitRule in grammar Git.
DEBUG:grammar.begin:Grammar Git:     active rules: [].
DEBUG:grammar.begin:Grammar Tmux: detected beginning of utterance.
DEBUG:grammar.begin:Grammar Tmux: executable 'TextEdit', title ''.
DEBUG:context.match:AppContext(['alacritty'], None, False): No match, executable doesn't match.
DEBUG:grammar.load:Grammar Tmux: deactivating rule TmuxRule.
DEBUG:engine:Deactivating rule TmuxRule in grammar Tmux.
DEBUG:grammar.load:Grammar Tmux: deactivating rule _IntegerRef_15.
DEBUG:grammar.begin:Grammar Tmux:     active rules: [].
DEBUG:grammar.begin:Grammar casterplugin.bringme.BringMe: detected beginning of utterance.
DEBUG:grammar.begin:Grammar casterplugin.bringme.BringMe: executable 'TextEdit', title ''.
DEBUG:grammar.begin:Grammar casterplugin.bringme.BringMe:     active rules: ['BringMeProgram'].
DEBUG:grammar.begin:Grammar Git: detected beginning of utterance.
DEBUG:grammar.begin:Grammar Git: executable 'TextEdit', title ''.
DEBUG:context.match:AppContext(['firefox'], None, False): No match, executable doesn't match.
DEBUG:grammar.begin:Grammar Git:     active rules: [].
DEBUG:grammar.begin:Grammar casterplugin.dictation.DictationPlugin: detected beginning of utterance.
DEBUG:grammar.begin:Grammar casterplugin.dictation.DictationPlugin: executable 'TextEdit', title ''.
DEBUG:grammar.begin:Grammar casterplugin.dictation.DictationPlugin:     active rules: ['CCR_Alphabet_Punctuation_Control_Format', 'Alphabet', 'Punctuation', '_IntegerRef_11', '_IntegerRef_12', 'Control', '_IntegerRef_09', '_IntegerRef_07', '_IntegerRef_10', 'Format'].
DEBUG:grammar.begin:Grammar Control: detected beginning of utterance.
DEBUG:grammar.begin:Grammar Control: executable 'TextEdit', title ''.
DEBUG:grammar.begin:Grammar Control:     active rules: ['ControlRule'].
DEBUG:engine:active kaldi_rules (from window {'executable': 'TextEdit', 'title': '', 'handle': 446573}): ['casterplugin.dictation.DictationPlugin::CCR_Alphabet_Punctuation_Control_Format', 'casterplugin.dictation.DictationPlugin::Format', 'casterplugin.dictation.DictationPlugin::Alphabet', 'casterplugin.bringme.BringMe::BringMeProgram', 'Control::ControlRule', 'casterplugin.dictation.DictationPlugin::Control', 'casterplugin.dictation.DictationPlugin::Punctuation']
DEBUG:engine:computing activity 171 ms
Level 15:kaldi.wrapper:decoded at 0.08 RTF, for 440 ms audio, spending 36 ms, of which 33 ms (92%) in finalization
Level 13:kaldi.wrapper:    decode times: 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 33
DEBUG:kaldi.compiler:parse_output('#nonterm:rule1 #nonterm:end')
Level 12:engine:Alignment (word,time,length): (('#nonterm:rule1', 0, 0), ('#nonterm:end', 0, 0))
Level 15:engine:End of phrase: eer=0.02 conf=nan [BAD], rule None, ''

Platform: MacOS (11.2.3)

> python --version                                                                                                                                                                                                                
Python 3.9.5
> pip freeze
argon2-cffi==20.1.0
-e git+https://github.com/Timoses/caster-core.git@a08c7a988f328d2edec49621146d147141741635#egg=caster_core
caster-plugins @ git+https://github.com/Timoses/caster-plugins.git@2f6bfd6b52594a8431364213bb8b829270a783e3
caster-timoses @ file:///Users/Timoses/code/voice/caster-timoses
castervoice==0.1.dev39+gb3b5841
certifi==2020.12.5
cffi==1.14.5
chardet==4.0.0
construct==2.10.54
decorator==5.0.9
dragonfly2==0.31.2
future==0.18.2
idna==2.10
json-rpc==1.13.0
kaldi-active-grammar==2.1.0
lark-parser==0.8.9
libtmux==0.8.5
lxml==4.6.3
numpy==1.20.3
packaging==20.9
py-applescript==1.0.0
pycparser==2.20
pycryptodomex==3.10.1
pykeepass==4.0.1
pynput==1.7.3
pyobjc==7.2
pyobjc-core==7.2
pyobjc-framework-Accessibility==7.2
pyobjc-framework-Accounts==7.2
pyobjc-framework-AddressBook==7.2
pyobjc-framework-AdServices==7.2
pyobjc-framework-AdSupport==7.2
pyobjc-framework-AppleScriptKit==7.2
pyobjc-framework-AppleScriptObjC==7.2
pyobjc-framework-ApplicationServices==7.2
pyobjc-framework-AppTrackingTransparency==7.2
pyobjc-framework-AuthenticationServices==7.2
pyobjc-framework-AutomaticAssessmentConfiguration==7.2
pyobjc-framework-Automator==7.2
pyobjc-framework-AVFoundation==7.2
pyobjc-framework-AVKit==7.2
pyobjc-framework-BusinessChat==7.2
pyobjc-framework-CalendarStore==7.2
pyobjc-framework-CallKit==7.2
pyobjc-framework-CFNetwork==7.2
pyobjc-framework-ClassKit==7.2
pyobjc-framework-CloudKit==7.2
pyobjc-framework-Cocoa==7.2
pyobjc-framework-Collaboration==7.2
pyobjc-framework-ColorSync==7.2
pyobjc-framework-Contacts==7.2
pyobjc-framework-ContactsUI==7.2
pyobjc-framework-CoreAudio==7.2
pyobjc-framework-CoreAudioKit==7.2
pyobjc-framework-CoreBluetooth==7.2
pyobjc-framework-CoreData==7.2
pyobjc-framework-CoreHaptics==7.2
pyobjc-framework-CoreLocation==7.2
pyobjc-framework-CoreMedia==7.2
pyobjc-framework-CoreMediaIO==7.2
pyobjc-framework-CoreMIDI==7.2
pyobjc-framework-CoreML==7.2
pyobjc-framework-CoreMotion==7.2
pyobjc-framework-CoreServices==7.2
pyobjc-framework-CoreSpotlight==7.2
pyobjc-framework-CoreText==7.2
pyobjc-framework-CoreWLAN==7.2
pyobjc-framework-CryptoTokenKit==7.2
pyobjc-framework-DeviceCheck==7.2
pyobjc-framework-DictionaryServices==7.2
pyobjc-framework-DiscRecording==7.2
pyobjc-framework-DiscRecordingUI==7.2
pyobjc-framework-DiskArbitration==7.2
pyobjc-framework-DVDPlayback==7.2
pyobjc-framework-EventKit==7.2
pyobjc-framework-ExceptionHandling==7.2
pyobjc-framework-ExecutionPolicy==7.2
pyobjc-framework-ExternalAccessory==7.2
pyobjc-framework-FileProvider==7.2
pyobjc-framework-FileProviderUI==7.2
pyobjc-framework-FinderSync==7.2
pyobjc-framework-FSEvents==7.2
pyobjc-framework-GameCenter==7.2
pyobjc-framework-GameController==7.2
pyobjc-framework-GameKit==7.2
pyobjc-framework-GameplayKit==7.2
pyobjc-framework-ImageCaptureCore==7.2
pyobjc-framework-IMServicePlugIn==7.2
pyobjc-framework-InputMethodKit==7.2
pyobjc-framework-InstallerPlugins==7.2
pyobjc-framework-InstantMessage==7.2
pyobjc-framework-Intents==7.2
pyobjc-framework-IOSurface==7.2
pyobjc-framework-iTunesLibrary==7.2
pyobjc-framework-KernelManagement==7.2
pyobjc-framework-LatentSemanticMapping==7.2
pyobjc-framework-LaunchServices==7.2
pyobjc-framework-libdispatch==7.2
pyobjc-framework-LinkPresentation==7.2
pyobjc-framework-LocalAuthentication==7.2
pyobjc-framework-MapKit==7.2
pyobjc-framework-MediaAccessibility==7.2
pyobjc-framework-MediaLibrary==7.2
pyobjc-framework-MediaPlayer==7.2
pyobjc-framework-MediaToolbox==7.2
pyobjc-framework-Metal==7.2
pyobjc-framework-MetalKit==7.2
pyobjc-framework-MetalPerformanceShaders==7.2
pyobjc-framework-MetalPerformanceShadersGraph==7.2
pyobjc-framework-MLCompute==7.2
pyobjc-framework-ModelIO==7.2
pyobjc-framework-MultipeerConnectivity==7.2
pyobjc-framework-NaturalLanguage==7.2
pyobjc-framework-NetFS==7.2
pyobjc-framework-Network==7.2
pyobjc-framework-NetworkExtension==7.2
pyobjc-framework-NotificationCenter==7.2
pyobjc-framework-OpenDirectory==7.2
pyobjc-framework-OSAKit==7.2
pyobjc-framework-OSLog==7.2
pyobjc-framework-PassKit==7.2
pyobjc-framework-PencilKit==7.2
pyobjc-framework-Photos==7.2
pyobjc-framework-PhotosUI==7.2
pyobjc-framework-PreferencePanes==7.2
pyobjc-framework-PushKit==7.2
pyobjc-framework-Quartz==7.2
pyobjc-framework-QuickLookThumbnailing==7.2
pyobjc-framework-ReplayKit==7.2
pyobjc-framework-SafariServices==7.2
pyobjc-framework-SceneKit==7.2
pyobjc-framework-ScreenSaver==7.2
pyobjc-framework-ScreenTime==7.2
pyobjc-framework-ScriptingBridge==7.2
pyobjc-framework-SearchKit==7.2
pyobjc-framework-Security==7.2
pyobjc-framework-SecurityFoundation==7.2
pyobjc-framework-SecurityInterface==7.2
pyobjc-framework-ServiceManagement==7.2
pyobjc-framework-Social==7.2
pyobjc-framework-SoundAnalysis==7.2
pyobjc-framework-Speech==7.2
pyobjc-framework-SpriteKit==7.2
pyobjc-framework-StoreKit==7.2
pyobjc-framework-SyncServices==7.2
pyobjc-framework-SystemConfiguration==7.2
pyobjc-framework-SystemExtensions==7.2
pyobjc-framework-UniformTypeIdentifiers==7.2
pyobjc-framework-UserNotifications==7.2
pyobjc-framework-UserNotificationsUI==7.2
pyobjc-framework-VideoSubscriberAccount==7.2
pyobjc-framework-VideoToolbox==7.2
pyobjc-framework-Virtualization==7.2
pyobjc-framework-Vision==7.2
pyobjc-framework-WebKit==7.2
pyparsing==2.4.7
pyperclip==1.8.2
python-dateutil==2.8.1
PyYAML==5.4.1
regex==2021.4.4
requests==2.25.1
six==1.16.0
sounddevice==0.3.15
urllib3==1.26.5
ush==3.1.0
webrtcvad-wheels==2.0.10.post2
Werkzeug==2.0.1

Any idea?

LexiconCode commented 3 years ago

There are two main methods to help troubleshoot.

One is to use the text engine. This cuts the speech recognition framework out of the equation.

The second and most applicable would be to use a python file with the '.execute()' example 'Text("test text").execute()'/'Key("w-c").execute()' or any other dragonfly action.

In both situations you can set the debugging levels for dragonfly for actions. That way the logs are a lot cleaner. In addition it provides a simple test case that duplicates the issue.

Timoses commented 3 years ago
> cat test.py
from dragonfly import Text
Text("test text").execute()

Would this work? I'd expect 'test text' to be typed when I execute it with python test.py.

However, nothing happens.

LexiconCode commented 3 years ago

Yes I believe that should work although I run it through vs code.

from dragonfly import Text

import logging
logging.getLogger("action").setLevel(logging.DEBUG)
logging.basicConfig()
Text("test test").execute()

See logging and default_levels for more options.

drmfinlay commented 3 years ago

Hi @Timoses,

Thank you for your report. Is the app running Python (e.g. Terminal) listed in the macOS preferences for apps allowed to control your computer? These apps are listed under System Preferences -> Security & Privacy -> Privacy (tab) -> Accessibility (section).

If the relevant app has accessibility access on your system, then I'm not sure what else could be causing this to happen. I was only able to replicate this behaviour on macOS 11.2.3 by revoking accessibility access.

Timoses commented 3 years ago

Yes, Alacritty (my terminal emulator) is in the accessibility section.

I just added 'tmux' to it (System Preferences -> Security & Privacy -> Privacy (tab) -> Accessibility) and now it works.. Didn't think that would be it because it worked previously.

Thanks for the hint.

drmfinlay commented 3 years ago

Ah, that is odd. Glad you got that sorted out.

I have opened a pynput issue for this: https://github.com/moses-palmer/pynput/issues/389. pynput is the input library we use on macOS. I think a warning message should be printed if there is no accessibility access.