-
Notifications
You must be signed in to change notification settings - Fork 144
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
Add method to disable speech plugin from python #213
base: master
Are you sure you want to change the base?
Add method to disable speech plugin from python #213
Conversation
Hi, there must be a softer way of disabling speech recognition than disposing the whole thing? |
Sure. The goal I'd like to shoot for is to have |
It seems the recognition engine is specifically programmed to look for specific words, ie. after This could either be through some form_on_me = None
if joystick[0].getDown(0):
if form_on_me is None:
form_on_me = speech.recognize("form on me")
elif form_on_me.said():
# execute keyboard macro
form_on_me.reset() # Or stop(). What if it's said again? You usually don't want the macro to be executed every time FreePIE iterates the script
else:
form_on_me and form_on_me.stop()
form_on_me = None Could also have a |
Another way of doing it could be have an active bool within the It could look something like this: speech.enable_recognition(joystick[0].getDown(0))
if speech.said("form on me"):
# execute keyboard macro |
b21a376
to
ce3ccf7
Compare
Made the change to support the example above. The plugin can still be fully stopped via the python interface but is not needed to pause the recognition engine from running to support to push to recognize. |
That seems much better! More so since there is no corresponding start method. And no other plugin have exposed start/stop methods. |
Instead of Currently it seems possible to call In addition this |
It was made so it would be as simple as possible for a non programmer. |
Maybe we should in DoBeforeNextExecute take all results and cache them until next DoBeforeNextExecute. And clear the dictionary. This way you only get one "frame" worth of results |
That might be a better solution becasue then you dont even need the enable feature |
1 similar comment
That might be a better solution becasue then you dont even need the enable feature |
For the record I wasn't commenting on the original design at all! Just evaluating a bunch of scenarios and thinking up how we can make this as simple yet predictable as possible.
Yeah, I think I like resetting it after a frame directly instead of resetting it only when |
Yep its for sure a breaking change. Might be worth it though |
ce3ccf7
to
c3813c0
Compare
Slimmed down the change to just include the |
@AndersMalmgren would there be anything else you'd like to see in this PR before it can be pulled? |
I want to do a POC on frame capture of speech input. I think it's a cleaner approach. The current state of the plugin is counter intuitive. |
Adds the ability to shut down speech recognition plugin via python.
The problem I ran into was when adding a push to talk voice recognition was that while the push to talk button was not held speech was being recognized and queued internally, and as soon as the push to talk button was pressed all previously said phrases that should not have been recognized would fire.
This change would allow a user to configure speech recognition in a push to talk fashion like this:
Rapidly enabling and disabling the speech recognition engine doesn't seem to have any performance impact.