Danesprite on master
Remove unnecessary install requ… (compare)
Danesprite on major
Remove multiple engine options … Remove the dragonfly.util sub-p… Make dragonfly.accessibility su… (compare)
Danesprite on master
Clarify sections of the documen… (compare)
Danesprite on major
Remove dragonfly.rpc sub-packag… (compare)
Danesprite on master
Update sections of the document… (compare)
Danesprite on master
Remove unused test suite module (compare)
Danesprite on minor
Fix Kaldi marking of whether re… Add Kaldi optional local or onl… Update Kaldi version, to fix er… and 32 more (compare)
Danesprite on major
Remove training mode from the S… Remove built-in sleep/wake mode… (compare)
Danesprite on talon-dev
Danesprite on master
Add missing documentation file … (compare)
Danesprite on 0.35.0
Danesprite on master
Update changelog Update to version 0.35.0 Pleas… (compare)
I had a question about dragonfly -- curious how you all solve problems like saying "right four" which becomes "right for" often (when trying to move the cursor right four times). The same thing happens when saying "enter" and a few other words.
Do you have any advice on navigating this - is there a way to help Dragon(fly) recognize "right four" instead of "right for"?
@altosaar @daanzu I have noticed DNS recognises my commands like this sometimes.
Dragonfly's English-language integers were changed a little while ago to include alternatives "to" and "too" for the number "two". I think it was a mistake to add these, however, and will be removing them in a future version because they are confusing.
Maybe you have noticed this behaviour @lunixbochs?
Yes, DNS certainly has its issues. It is good that Kaldi doesn't have this or certain other issues. Those alternatives for 2 are annoying when you want to type the word number "two". My mistake for not thinking the changes through.
I notice that SAPI 5 has a slightly different, but related problem recognising Dragonfly's "oh" alternative for "zero".
I wonder if anyone in this channel would be interested in my enabling Dragonfly's X11 integration to work remotely, e.g. via SSH forwarding. I haven't actually tested it, but I suspect it may work in some environments if the required programs are available locally. Certainly it could be made to work more nicely on Windows and macOS.
It is rather late here, but it seems to me this is an alternative way of achieving what Aenea does: communing with the remote X11 server directly.
Mine too, at least on my Linux box. I'll see what I can do.
I think this has the potential to be less brittle than Aenea and, perhaps, easier to set up. Much more so if Dragonfly used python-xlib for everything. It would also be much more flexible than Aenea in certain scenarios.
Hi All, Im very new to dragonfly, trying to get the BringApp action to work but it fails to open the directory when I pass it BringApp("explorer", r"C:\DT\natlink\src\natlinkpy\MacroSystem"). I read it passes to subprocess.Popen so I tried to replicate it in cmd and use subprocess.Popen(["explorer", r"C:\DT\natlink\src\natlinkpy\MacroSystem"]) directly and that DID work. Anyone know what I might be doing wrong with BringApp? I tried passing my args in a list and Ive succesfully used other rules in the grammerfile, but so far no luck with BringApp..
Is it part of a function or is it tied directly to command?
If it's part of the function then it needs .execute()
BringApp("explorer", r"C:\DT\natlink\src\natlinkpy\MacroSystem").execute()
at the end of the action
For debugging I recommend Running Test Engine from Dragonfly CLI which can run alongside DNS/Speech recognition engine. Which allows you to type commands as if the engine heard them with 100% accuracy. You can debug individual files _dragonfly_example_rule.py
Or anything with an _
via_*.py
.
python -m dragonfly test _dragonfly_example_rule.py -l DEBUG --delay 3
Type commands to emulate as if they are being dictated by voice.
lowercase mimics commands
, UPPERCASE mimics free dictation
Upper and lowercase words can be mixed e.g say THIS IS A TEST
Edit the --delay 3
to change command delay in seconds.
The delay allows user to switch to the relevant application to test commands
StartApp("explorer", r"C:\Windows").execute()
works as expected. I could've swore BringApp was capable opening up file paths from explore.import logging
logging.basicConfig()
logging.getLogger('action').setLevel(logging.DEBUG)
from dragonfly import BringApp, StartApp
BringApp("explorer", r"C:\Windows").execute()
can you just use python's atexit.register?
That thought I hadn't considered. Thanks
@samVanDerStoop @LexiconCode Regarding BringApp
and explorer.exe, this problem is occurring because BringApp
is internally matching any explorer.exe window and concluding that the specified application is already open.
This problem can be solved by specifying additional BringApp
keyword arguments or with a subclass of BringApp
. I have uploaded a BringFileman
subclass for this as a GitHub "gist": https://gist.github.com/Danesprite/96f5a27eadaf61ced95e5de55950f31c
@samVanDerStoop @LexiconCode Regarding
BringApp
and explorer.exe, this problem is occurring becauseBringApp
is internally matching any explorer.exe window and concluding that the specified application is already open.This problem can be solved by specifying additional
BringApp
keyword arguments or with a subclass ofBringApp
. I have uploaded aBringFileman
subclass for this as a GitHub "gist": https://gist.github.com/Danesprite/96f5a27eadaf61ced95e5de55950f31c
Thanks Dane
on_recognition
[('say', 2), ('hello', 1000000)]
hello how are you # Free dictation
[('hello', 0), ('how', 0), ('are', 0), ('you', 0)]
say hello # Command
[('say', 2), ('hello', 1000000)]
def on_recognition(self, words, results):
print("{}".format(" ".join(words)))
print("{}".format(results.getResults(0)))
@samVanDerStoop @LexiconCode Regarding
BringApp
and explorer.exe, this problem is occurring becauseBringApp
is internally matching any explorer.exe window and concluding that the specified application is already open.This problem can be solved by specifying additional
BringApp
keyword arguments or with a subclass ofBringApp
. I have uploaded aBringFileman
subclass for this as a GitHub "gist": https://gist.github.com/Danesprite/96f5a27eadaf61ced95e5de55950f31c
Thank you much. For my own understanding could you explain how I might specify additional BringApp kwargs correctly for the natlink\MacroSystem example? It would help me understand what your subclass is correcting before passing to BringApp
Reading about dragonfly I found multiple references to the multi edit grammar at https://github.com/t4ngo/dragonfly-modules/tree/master/command-modules
I tried to get it to work myself (as a way of practicing with sequences of commands and config files) but had little luck.
As is, I only get this message
An exception occurred loading 'natlinkmain' module
Error message:
'_multiedit'
When I altered some odd indenting in the file and tried again, I got
Traceback (most recent call last):
File "C:\Program Files (x86)\Python38-32\lib\site-packages\dragonfly\engines\base\timer.py", line 159, in main_callback
now = time.time()
SystemError: <built-in function time> returned a result with an error set
If there is a problem with a built-in function might this be a python2/python3 issue (I installed natlink succesfully using the experimental python3 version)? I know the grammar is quite old. Any ideas for a quick fix, or maybe better examples of grammars using configs and sequences of commands/continous command recognition that I can base my own rules on?
_multiedit
everything seems to work fine. If you haven't already update to the latest Natlink natlink 5.1.1 for Python 3. Instructions dictation-toolbox/Caster#911 works for anybody not just Caster users.
pip install natlink --upgrade
and using thenatlinkconfig_cli
as needed. Since the user directory was set I didn't have to reset it. It is a heck of a lot easier then utilizing the old way. So it's up to you.
@LexiconCode Formatting is done after observer events. To do it yourself, pass the unformatted words list to Dragonfly's DNS dictation word formatter classes:
from dragonfly.engines.backend_natlink.dictation_format import WordFormatter
words = "\\all-caps\\All-Caps hello world".split()
formatter = WordFormatter()
formatted_output = formatter.format_dictation(words)
print(formatted_output)
There are more examples in the doctests: https://dragonfly2.readthedocs.io/en/latest/test_word_formatting_v11_doctest.html
This is not done for integers. IIRC DNS does not provide this information to client applications. You need to pass the words through Dragonfly's integer content classes for that.