Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 01 05:24
    daanzu commented #360
  • Nov 30 00:34

    Danesprite on master

    Fix Kaldi marking of whether re… Add Kaldi optional local or onl… Update Kaldi version, to fix er… and 2 more (compare)

  • Nov 30 00:34
    Danesprite closed #360
  • Nov 30 00:34
    Danesprite commented #360
  • Nov 29 06:03
    Danesprite commented #360
  • Nov 29 05:06
    daanzu commented #360
  • Nov 29 05:01
    daanzu commented #360
  • Nov 29 03:19

    Danesprite on minor

    Update accessibility API docume… (compare)

  • Nov 28 23:57
    Danesprite commented #360
  • Nov 28 15:58
    LexiconCode commented #360
  • Nov 28 15:58
    LexiconCode commented #360
  • Nov 28 15:57
    LexiconCode commented #360
  • Nov 28 06:53
    Danesprite synchronize #360
  • Nov 28 06:39
    Danesprite commented #360
  • Nov 24 11:03
    daanzu commented #360
  • Nov 24 08:58
    daanzu synchronize #360
  • Nov 21 05:25
    Danesprite labeled #363
  • Nov 21 05:25
    Danesprite labeled #363
  • Nov 21 05:25
    Danesprite labeled #363
  • Nov 21 05:25
    Danesprite opened #363
Dane Finlay
@Danesprite

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".

Dane Finlay
@Danesprite

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.

Dane Finlay
@Danesprite
I would only be willing to do this for X11 because it already allows this sort of thing. Windows remote desktop, for instance, would be an entirely different matter, I think.
I would be interested in your thoughts on this, @shervinemami, if you have time. :-)
Shervin Emami
@shervinemami
Aenea is still part of my daily setup, so yeah I'm happy to give it a try.
Dane Finlay
@Danesprite

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.

Shervin Emami
@shervinemami
These days I use Aenea in a strange way, I only use it for transferring control & commands between my Windows VM & Linux, I don't use grammars in Aenea anymore.
Dane Finlay
@Danesprite
Oh, okay then. I guess that is related to your use of Autokey shortcuts for the actions?
Shervin Emami
@shervinemami
Oh wow, I looked through my scripts and realised that I don't actually use Aenea anymore! About a year ago I was confident enough about KaldiAG that I ported all my Aenea grammars & plugins to be KaldiAG & AutoHotKey/DNS based, so it could work without an Aenea server. I totally forgot! No wonder I rarely experience crashes these days 😆 At the time, I did also setup
samVanDerStoop
@samVanDerStoop
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..
Shervin Emami
@shervinemami
a minimal installation of Aenea without any plugins, and would run the Aenea client script in the Windows VM. That way, as long as the Aenea client window was the focused app within my Windows VM, I was able to use dictation (being processed in DNS in the Windows VM) to type sentences in Linux with good accuracy! So I was really hoping that it would be a really good combo. But if I remember correctly, I stopped using that soon after, because it was just way too unreliable. Occasionally it all worked perfectly, but often Dragon would decide to stop sending dictation to the Aenea client window. So I gave up on Aeneas (because of the bugs in Dragon, not Aenea), and for the past year I've made sure to open any dictation heavy apps or websites in my Windows VM, while everything else I use in my Linux system. So it's annoying to not be able to use Dragon to dictate into my Linux system, but I've managed to get by.
1 reply
LexiconCode
@LexiconCode

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

LexiconCode
@LexiconCode

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

LexiconCode
@LexiconCode
@samVanDerStoop However there must be an issue. Double checking I can utilize BringApp to launch other applications such as Notepad. However "explorer" does not seem to work for me either. For now StartApp("explorer", r"C:\Windows").execute() works as expected. I could've swore BringApp was capable opening up file paths from explore.
An alternative way to test executing a python file with some dragonfly debugging.
https://dragonfly2.readthedocs.io/en/latest/_modules/dragonfly/log.html#setup_log
import logging

logging.basicConfig()
logging.getLogger('action').setLevel(logging.DEBUG)

from dragonfly import BringApp, StartApp
BringApp("explorer", r"C:\Windows").execute()
samVanDerStoop
@samVanDerStoop
@LexiconCode Ill look into those methods of debugging. The fact it didn't work for you either makes me think it's not a problem in my code. I thought it hardly could be as Im literally using a modified sample file (I believe you gave it to :) thx) where I commented out all but that one rule. For now Ill use StartApp instead for this specific case
@LexiconCode it wasnt part of a function btw, just a rule in a mapping
LexiconCode
@LexiconCode

The fact it didn't work for you either makes me think it's not a problem in my code.

Yeah I'm pretty sure it's not related to your code.

samVanDerStoop
@samVanDerStoop

Odd question regarding the Key action, does this:
Key("shift:down") + Key("w:down"),

equal:
Key("s-w:down"),

Or is this not proper use of the modifier?

3 replies
LexiconCode
@lexicon-code:matrix.org
[m]
Is there a call back in dragonfly when it shuts down that I can execute a function?
Ryan Hileman
@lunixbochs
can you just use python's atexit.register?
LexiconCode
@lexicon-code:matrix.org
[m]

can you just use python's atexit.register?

That thought I hadn't considered. Thanks

Doug Ransom
@dougransom
for anyone interestd in debugging their stuff, you can use ouptutdebugstring from https://pypi.org/project/pydebugstring/. you only see the debug ouptut when you run debugview from microsoft.
David Zurow
@daanzu
@dougransom Neat, thanks!
Dane Finlay
@Danesprite

@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

LexiconCode
@LexiconCode

@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

Thanks Dane

Is there an easy way to get dragons interpretation of the If an utterance is dictation or a command?
LexiconCode
@LexiconCode
("some", 1000000), ("dictation ", 1000000) or ('some', 0), ('command', 0) Currently I can get it through DEBUG:engine:Grammar
Ideally you be nice to get during some sort of callback like on_recognition
LexiconCode
@LexiconCode
I think I figured it out.
[('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
@samVanDerStoop

@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

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

2 replies
samVanDerStoop
@samVanDerStoop

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?

LexiconCode
@LexiconCode
@samVanDerStoop Testing just with _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.
9 replies
samVanDerStoop
@samVanDerStoop
@LexiconCode Thats cool! Please forgive a few noobie questions: Does the new Natlink change anything for dragonfly, does it need to be updated too? Once Ive unregistered natlink, uninstalling just means deleting the cloned repository, right? I havent used/set a userdirectory yet,(I only put dragonfly scripts in \MacroSystem directly so far), so I dont think there are any other settings I need to revert..
LexiconCode
@LexiconCode
@samVanDerStoop No worries, I'm glad help. Nope the new version of nalink does not impact dragonfly. None of Nalinks Interfaces have changed just updated a Python 3 and packaged on a much easier way to install. Yes after un-registering and deleting the cloned repository (with DNS closed) you should be good upgrade. This new version is somewhat experimental so if you experience any issues let us know on the natlink repository/chat.
samVanDerStoop
@samVanDerStoop
@LexiconCode Thanks a lot! Seeing as it is still so new, do you think I might better wait a bit in case changes have to be made (I dont know how easy it would be to update)?
LexiconCode
@LexiconCode
@samVanDerStoop I've already updated once with the with the new version. It was a simple 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
@lexicon-code:matrix.org
[m]
Is it possible @Danesprite to get DPI is formatted output in recognition Observer? Like if I dictate five thousand the observer returns 5000 or whatever DNS is final output would be?
Dane Finlay
@Danesprite

@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.

LexiconCode
@LexiconCode
Thank you!
Dane Finlay
@Danesprite
No worries!
Dane Finlay
@Danesprite
I should mention that you can use the DNS dictation formatting classes to save state information between utterances. Dragonfly doesn't do that because it would lead to some commands having inconsistent effects.
Alex Boche
@alexboche
i made an issue about that formatting stuff a while back #110 Not sure if anything there is relevant to what you're talking about. I think there was also a caster issue. Last I checked the talon community seemed to be pretty die hard into just using various "say [dictation]" type commands for everying instead of fancing transitioning or using separate modes. They may be right, especially with super low latency where pausing isn't so bad.
LexiconCode
@lexicon-code:matrix.org
[m]
natlink 5.1.2 has been released in which you can give an environment variable DICTATIONTOOLBOXUSER pointing to a directory in which the folder .natlink can be located. Simply re-register natlink after setting up the variable
Doug Ransom
@dougransom
@lexicon-code:matrix.org can you note that in the readme.md? otherwise it will be a big secret.
LexiconCode
@LexiconCode
@dougransom Sure in Natlink docs?
Quintijn Hoogenboom
@quintijn
I will work on the readthedocs, yes!
LexiconCode
@LexiconCode

@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.

This solves formatting the problem of free dictation with DNS and commands are not a problem. However the dictation element remains troublesome. The purpose of displaying things on a HUD would be what you see is what you got for output on the screen. If any formatting has been applied to a dictation element it of course does not show as it's not applied yet. Any thoughts to overcome the issue with dictation elements?

1 reply
Quintijn Hoogenboom
@quintijn
Did you ever try the nsformat module in natlinkcore? This was originally written by Joel Gould, to solve the formatting of the <dgndictation> imported rule
LexiconCode
@LexiconCode

Did you ever try the nsformat module in natlinkcore? This was originally written by Joel Gould, to solve the formatting of the <dgndictation> imported rule

@quintijn That's an interesting thought as I'm already importing DNS the specific code so why not Natlink directly. Thank you.

Quintijn Hoogenboom
@quintijn
@LexiconCode : I checked nsformat.py with unittestNsformat.py. One failure, that was in 2010 already a failure. I did only commit to "makeflitinstall". If you want an extra release, I will make it...