## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### Activity
• Apr 04 04:17
Danesprite labeled #367
• Apr 04 04:17
Danesprite assigned #367
• Apr 04 04:17
Danesprite opened #367
• Apr 04 04:02

Danesprite on master

Remove unnecessary install requ… (compare)

• Apr 04 04:02

Danesprite on major

Remove multiple engine options … Remove the dragonfly.util sub-p… Make dragonfly.accessibility su… (compare)

• Mar 31 05:17

Danesprite on master

Clarify sections of the documen… (compare)

• Mar 31 05:17

Danesprite on major

Remove dragonfly.rpc sub-packag… (compare)

• Mar 23 11:43
Danesprite closed #354
• Mar 23 11:43
Danesprite commented #354
• Mar 22 10:39
Danesprite closed #337
• Mar 22 10:39

Danesprite on master

Update sections of the document… (compare)

• Mar 20 06:09

Danesprite on master

Remove unused test suite module (compare)

• Mar 20 06:02

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)

• Mar 20 06:01

Danesprite on major

Remove training mode from the S… Remove built-in sleep/wake mode… (compare)

• Mar 20 05:36

Danesprite on talon-dev

• Mar 19 11:42

Danesprite on master

Add missing documentation file … (compare)

• Mar 19 11:36
Danesprite closed #240
• Mar 19 11:36
Danesprite labeled #240
• Mar 19 11:35

Danesprite on 0.35.0

• Mar 19 11:35

Danesprite on master

Update changelog Update to version 0.35.0 Pleas… (compare)

westocl
@westocl
@Danesprite Thanks for the insight! I will take a look at the first (first), and if that doesnt work, i will try the second.
westocl
@westocl
I may have asked something like this before, would it be possible to run python3/Dragonfly in the browser? U was looking at the Pyodide project for another reason, then thought whether it would work with Dragonfly. It would be great to ensure that every use would have the same environment in a deployment situation. I'm not exactly sure how the browser would take speech input though.
Dane Finlay
@Danesprite

@westocl No problem, glad I could help.

It is a nice thought, but Dragonfly would not work correctly with Pyodide at all. Many components would be broken by such an environment, the most important being the libraries used for audio input and speech recognition. These libraries (e.g., Natlink) would need to be compiled specially. Aside from that, IPC with Dragon (or WSR) would be made impossible and interaction with the OS severely limited by the "sandboxing" of the browser.

westocl
@westocl
@Danesprite Thanks for the reply. ... makes sense
DanKaplanSES
@DanKaplanSES
There are a a lot of phrases that use the word point, and this usually makes me have to go back and add space around the word.
Dane Finlay
@Danesprite
It looks like it is for numbers with decimal points, e.g., "three point one four".
Is this problem occurring with DNS?
DanKaplanSES
@DanKaplanSES
yep
hrm... doesn't happen consistently
I just tried to reproduce it and I can't, but it happens quite a lot to me
Dane Finlay
@Danesprite
I see. I think, when the problem occurs, DNS is mistaking "point" for the special word ".\point\point".
DanKaplanSES
@DanKaplanSES
yeah, me too
it's inconsistent.it just happened to me by saying, "she'll respond with something that completely misses the point" but I cannot reproduce it
Dane Finlay
@Danesprite
DNS is quite quirky, isn't it? Now there's a problem, now there isn't. ;-)
Anyhow, removing the entry from property_map might fix this:
from dragonfly.engines.backend_natlink.dictation_format import WordParserDns11
WordParserDns11.property_map.pop("point")
DanKaplanSES
@DanKaplanSES
it totally is. since yesterday, the num keyword isn't working for me correctly. num 1 2 3 prints Number 123
ah, caster issue
I said enable numbers and it started working again. Probably a caster bug
at least, I didn't intentionally disable it
Dane Finlay
@Danesprite
Ah, well at least there was a simple fix for that one.
DanKaplanSES
@DanKaplanSES
yep :)
David Roundy
@droundy
I'm wondering if anyone has tried setting up a foot pedal
to activate listening for voice commands?
It seems like a way to reduce the chance of wife walking in and accidentally causing the computer to do something due to forgetting to say "stop listening"
Shervin Emami
@shervinemami
Hi @droundy, yeah I recommend getting a foot switch, it's very handy! I use a 3-way USB footswitch pedal by PC Sensor. It comes with drivers on a CD for Windows but there's an open-source tool for customising it in Linux & Mac: https://github.com/rgerganov/footswitch
I change the functions every few months, but generally I use one to enter dictation mode while my foot is down (and go back into command mode when I release my foot), and another foot to signal an error in speech recognition, and the 3rd is to do type my password or enter a command I often use.
David Roundy
@droundy
@shervinemami How do you connect the for switch up to dragonfly to change mode? It would seem that your dragonfly script would either need to listen for keystrokes or to poll the switch?
Shervin Emami
@shervinemami

Hi @droundy , yes I put a hook to listen for keyboard events. I'm using Kaldi backend, so I put this at the bottom of my existing _dictation_mode.pyfile (that you can see at "https://github.com/Danesprite/dictation-mode-grammar/blob/master/_dictation_mode.py"):

import threading

# A thread function callback that is blocking
from pynput import keyboard
print("Waiting in the background for global hotkeys that switch dictation modes ...")
# This function is unused because we use on_press & on_release directly. But it's left here for compilation purposes
def on_activate():
print('Global dictation-mode hotkey activated!')

def key_pressed(a):
#print('key pressed!', a)
# If the user is holding down the NumLock key, switch to Dictation mode.
if a == keyboard.Key.num_lock:
print('Global dictation-mode hotkey pressed!', a)
grammar.status = 2      # Dictation-only mode

def key_released(a):
#print('key released!', a)
# If the user released the NumLock key, switch back to Command mode.
if a == keyboard.Key.num_lock:
print('Global dictation-mode hotkey released!', a)
grammar.status = 0      # Command-only mode

with keyboard.Listener(
on_press=key_pressed,
on_release=key_released) as h:
h.join()

# Setup event handlers for a few global hot keys, so the user can easily switch between Dictation vs Command mode.
# This function is non-blocking
def setupHotkeysForDictationModes():
mythread.daemon = True     # Don't block the parent thread from terminating when desired.

# Allow switching dictation mode
setupHotkeysForDictationModes()

This script creates a background thread to always listen for the numlock key going up or down. It's not "polling", most of the time this thread will be asleep, the pynput library wakes up this thread whenever any key is pressed on any "keyboard" attached to your computer (including USB foot pedals!). I then configured one of my footswitch pedals to be a NumLock key. eg:

sudo ./footswitch -1 -k numlock -2 -k F24 -3 -k scrollock                     # Pedal 1 = NumLock, Pedal 2 = media_play_pause/F24, Pedal 3 = ScrollLock
(By doing the setup above, you would then be using Kaldi in command mode by default, and while you are holding down that foot pedal it will be using Kaldi dictation mode, until you lift your foot and then it's back to Kaldi command mode.)
David Roundy
@droundy
Thanks @shervinemami that's very helpful. I wasn't aware of pynput, which seems pretty useful for this use case! And I hadn't thought to listen for press and release events like that.
comodoro
@comodorovo:matrix.org
[m]

This message is replying to a Matrix event but we were unable to find associated bridged Gitter message to put it in the appropriate threaded conversation.

Now the site is reachable, but probably does not have the appropriate content. I wonder if it is related to this: https://twitter.com/CMUSpeechGroup/status/1511806299490631681

danesprite
@danesprite:matrix.org
[m]

Hello comodoro,

Yes, the Kaldi backend uses this service for generating pronunciation strings of unknown words. The library was changed in version 0.34.0 to generate these strings locally by default. This problem should be solvable by upgrading to the new version:

pip install --upgrade dragonfly2

You may have to install the g2p_en package if you are using an older speech model.

JoHeinrich
@JoHeinrich
Hey guys i'm creating a channel about voice coding. This video shows how i do my definitions. Would be happy to get some feedback. https://youtu.be/kotWKOlcynI
comodoro
@comodorovo:matrix.org
[m]
Don't take me wrong, I think a local generator is superior to the online one, even though not so good in some edge situations.
JoHeinrich
@JoHeinrich
Yeah you are right. Its faster to have a local one.
danesprite
@danesprite:matrix.org
[m]

No problem.

Yes, there are pros and cons to both generators. It is possible to re-enable the online generator by setting the allow_online_pronunciations Kaldi engine option to True. See the engine documentation for how to do that. It looks like the service is still down for the moment, however.

I suppose the CMU Sphinx tools used by the online service are more refined than the g2pE library. They have certainly been around a little longer.

Dane Finlay
@Danesprite

Hello @JoHeinrich,
Nice demonstration video. Easy Voice Code looks very good!

The only feedback I have on this particular video is that the description is missing a link to easyvoicecode.net.

JoHeinrich
@JoHeinrich
Thank you @Danesprite i'm currently moving most of the stuff to seperate applications.
A sourcecode analyser to get every information about a c# project
My latest improvements are part of a visual studio extension. this way i can add a tone of custom actions.
The new system is designed to be used with dragonfly / talon voice or any other voice command system that might come up in the future
If you wanna give it a try i'll help you set it up
3 replies
Rebecca Stevenson
Hello everyone! I am setting up a new computer and I am trying to install the necessary python modules for Natlink (eg six, future), but it seems that pip doesn't work with python 2.7 anymore. I tried to download the files for 'six' through pypip, but get an error when running 'python setup.py install'. copying six.egg-info\top_level.txt -> build\bdist.win32\egg\EGG-INFO zip_safe flag not set; analyzing archive contents... six: module references __path__ creating dist creating 'dist\six-1.16.0-py2.7.egg' and adding 'build\bdist.win32\egg' to it Traceback (most recent call last): File "setup.py", line 57, in <module> python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*", File "C:\Python27\lib\site-packages\setuptools\__init__.py", line 143, in setup return distutils.core.setup(**attrs) File "C:\Python27\lib\distutils\core.py", line 151, in setup dist.run_commands() File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands self.run_command(cmd) File "C:\Python27\lib\distutils\dist.py", line 972, in run_command cmd_obj.run() File "C:\Python27\lib\site-packages\setuptools\command\install.py", line 67, in run self.do_egg_install() File "C:\Python27\lib\site-packages\setuptools\command\install.py", line 109, in do_egg_install self.run_command('bdist_egg') File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command self.distribution.run_command(command) File "C:\Python27\lib\distutils\dist.py", line 972, in run_command cmd_obj.run() File "C:\Python27\lib\site-packages\setuptools\command\bdist_egg.py", line 234, in run dry_run=self.dry_run, mode=self.gen_header()) File "C:\Python27\lib\site-packages\setuptools\command\bdist_egg.py", line 497, in make_zipfile visit(z, dirname, files) File "C:\Python27\lib\site-packages\setuptools\command\bdist_egg.py", line 490, in visit z.write(path, p) File "C:\Python27\lib\zipfile.py", line 1158, in write zinfo = ZipInfo(arcname, date_time) File "C:\Python27\lib\zipfile.py", line 328, in __init__ raise ValueError('ZIP does not support timestamps before 1980') ValueError: ZIP does not support timestamps before 1980
Anybody know how to get past this? Or do you have any other tips for getting Natlink to work on a new computer?
LexiconCode
@LexiconCode
python/cpython#8270 Looks like it's a bug that was fixed in C Python 3.8. However that doesn't explain the date issue in the first place. I have some time tomorrow where I could help you over Zoom or some other platform. Send me a direct message if you're interested (Hover over the name icon)
Dane Finlay
@Danesprite
I don't think upgrading Python should be necessary. Perhaps pip install dragonfly2 might work? Or is pip not installed?
Rebecca Stevenson
Pip wasn't installed since I was using a version of Python 2.7 that didn't include it and I couldn't get it to work using get-pip.py found here: https://www.liquidweb.com/kb/install-pip-windows/. However, I just found that pip is preinstalled on Python 2.7.9 so once I switch to that version hopefully I will be able to get everything to work. Fingers crossed I didn't break anything by trying to install things without pip... Thanks @Danesprite and @LexiconCode!
Dane Finlay
@Danesprite

@rebeccaFste_twitter Ah, I see. You have my sympathies; I've had similar trouble with Python 2.7 and pip. The manner in which the EOL deadline for v2.7 has been interpreted has made it more difficult to use older libraries.

Anyhow, good to know that version 2.7.9 works fine.

LexiconCode
@lexicon-code:matrix.org
[m]
I ended up helping her transition to Python 3 with Natlink.
Dane Finlay
@Danesprite
Whatever works. I still think 2.7 is good enough.
Rebecca Stevenson
fwiw I ended up running into some errors trying to install the necessary packages (e.g. pywin32) using pip after I switched to 2.7.9. Though I didn't troubleshoot for very long so maybe it would have worked eventually
Dane Finlay
@Danesprite

That's fair. I cannot deny that Python 3 is easier to work with now. You have everything up and running now then?

I will say that pywin32 in particular is best installed via their installer, available from the releases page. As I understand it, certain important post-install tasks for that package cannot be run via pip.

Rebecca Stevenson