-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented microphone modes #853
Conversation
- Removed EngineModesManager from nexus - Created ExclusiveManager and _sync_mode
extras = [ | ||
Choice( | ||
"mic_mode", { | ||
"off": "off", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get this when saying "caster off"
Caster: 'off' is not valid. set_mic_state modes are: 'off' - DPI Only, 'on', 'sleeping'
Is that deliberate? We should also have "caster wake" as an option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LexiconCode thanks for doing this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it is intentional ('off' - DPI Only). For other engines besides DPI/DNS to have an off state they need a method to turn the microphone on without voice activation like a keyboard shortcut/GUI toggle. DPI/DNS has that capability. Why sleep
with sleeping
?
There's a difference between sleep
the command and sleeping
which is passed as a parameter. sleeping
is what Natlink uses as a string to put DNS to sleep natlink.setMicState(mode)
.
The mode needs to be checked in EngineModesManager because they can be set in the caster settings for the engine to start up in a certain mode. Because the user is defining a string (a mode) within the settings which could be anything must be checked against valid modes.
"caster wake" would be possible but I don't really know why unless there is recognition issues. It's nice to provide something that's concise and intuitive. "wake" does feel natural but that's because of my experience of DNS. I would think most people without that experience would think "on" "off" "sleep".
One other bit of feedback is that the dictation element needs to be weighted for kaldi in sleep_rule
?
Using DPI 15.3 on Windows 10, all three commands (on, off, sleep) work perfectly. Good stuff. |
@LexiconCode is there an easy way to implement automatic sleeping functionality? I often forget that the system is on after using it for a few minutes and end up making it do a bunch of crazy things because I'm speaking around it or listening to something. |
Yes I think that shouldn't be too bad to do. It would involve creating a timer that is reset every time there's a successful recognition. |
Description
Implemented microphone modes to toggle microphone on, off, and sleep.
The new commands
caster <mode>
on, sleep, off (DNS/DPI only)These modes use grammar/rule exclusivity to block other grammars from being recognized.
These modes are implemented through 2 rules. The 1st rule
CasterMicRule
to execute the function to enable exclusivity. The 2nd rulesleep_rule
leverages native dragonfly to become exclusive viaExclusiveManager
overridingCasterMicRule
and all other rules loaded into the engine.sleep_rule
uses dragonflyFuncContext
to toggle on and off. Both rules useEngineModesManager
to manage the different modes based on the engine is running. There are some significant differences. DNS utilizes Natlink and_sync_mode
to synchronize modes then uses ExclusiveManager. The other engines utilize just ExclusiveManager.Note because native dragonfly was used for
sleep_rule
simplified transformers cannot be used onCasterMicRule
orsleep_rule
.Could this implementation be simplified?
If we could create separate CCR merger that's for exclusive grammars only it would drastically simplify the implementation.
What about additional modes?
These are some thoughts for the future but not in this PR. I did not want to take longer to get the sleep mode out to users as it impacts the usability of Caster.
Related Issue
#797
Motivation and Context
Motivation for this is to unify microphone modes command regardless of the speech recognition backend for users.
How Has This Been Tested
I've tested this with DNS and Kaldi switching between microphone modes.
Types of changes
Checklist
Maintainer/Reviewer Checklist