Skip to content
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

Added "found_wakeword" event to message bus #2367

Merged
merged 1 commit into from Nov 11, 2019
Merged

Conversation

@speedfox-uk
Copy link
Contributor

speedfox-uk commented Oct 19, 2019

Description

Added an event to the message bus that will be sent when the wakeword
is found and before the notification sound is played

How to test

Connect to the message bus and output all of the messages. Say the wakeword. You should see the "found_wakeword" message,

Contributor license agreement signed?

Yes

@devs-mycroft

This comment has been minimized.

Copy link
Collaborator

devs-mycroft commented Oct 19, 2019

Hello, @speedfox-uk, thank you for helping with the Mycroft project! We welcome everyone
into the community and greatly appreciate your help as we work to build an AI
for Everyone.

To protect yourself, the project, and users of Mycroft technologies we require
a Contributor Licensing Agreement (CLA) before accepting any code
contribution. This agreement makes it crystal clear that along with your
code you are offering a license to use it within the confines of this project.
You retain ownership of the code, this is just a license.

Please visit https://mycroft.ai/cla to initiate this one-time signing. Thank
you!

@forslund

This comment has been minimized.

Copy link
Member

forslund commented Oct 29, 2019

Hi This is working as expected...however it seems like the recognizer_loop:wakeword should mean the same thing. But that seem to be broken in some way. We should try to determine why the original message is late...

@speedfox-uk

This comment has been minimized.

Copy link
Contributor Author

speedfox-uk commented Oct 29, 2019

It's broken because the message tone is played in the same method that does the wakeword detection (_wait_until_wake_word in mic.py). The other way to fix this would be to take playing the wakeword detected tone out of _wait_until_wake_word and put it somewhere after the wakeword message has been sent. Either that or remove the current "wakeword" message and just rename my new message to that. I don't mind either way.

@forslund

This comment has been minimized.

Copy link
Member

forslund commented Oct 29, 2019

It's a bit more than that, (at least to me) it seems like it's not sent until after the recording of the STT phrase is complete...

@forslund

This comment has been minimized.

Copy link
Member

forslund commented Oct 29, 2019

I do think it'd be best if your message was renamed but that would also require the session id to be included

SessionManager.touch()                                                  
        payload = {                                                             
            'utterance': self.wakeword_recognizer.key_phrase,                   
            'session': SessionManager.get().session_id,                         
        }                                                                       
        self.emitter.emit("recognizer_loop:wakeword", payload)

And the corresponding section in listener.py should be removed.

@speedfox-uk

This comment has been minimized.

Copy link
Contributor Author

speedfox-uk commented Oct 29, 2019

OK, I'll make the change after I get home and update the PR.

@speedfox-uk

This comment has been minimized.

Copy link
Contributor Author

speedfox-uk commented Oct 30, 2019

I've renamed it to "wakeword" and removed the old one. I'm just grabbing the utterance from "self.wake_word_name" rather than keeping a reference to the wakeword recogniser because it seemed like a simpler solution.

@forslund

This comment has been minimized.

Copy link
Member

forslund commented Oct 30, 2019

Thanks, will look it over and hopefully merge tomorrow.

@forslund forslund requested a review from davidwagnerkc Nov 1, 2019
@forslund

This comment has been minimized.

Copy link
Member

forslund commented Nov 1, 2019

@davidwagnerkc had done some similar work so I've assigned him to do the review of these changes.

Copy link
Contributor

davidwagnerkc left a comment

Sorry for the delay. This makes much more sense. Thanks for taking the time to get a PR up.

@speedfox-uk

This comment has been minimized.

Copy link
Contributor Author

speedfox-uk commented Nov 11, 2019

No problem. Just happy that this is making its way into master.

The message is now emitted directly after a wakeword is detected.
@forslund forslund force-pushed the speedfox-uk:dev branch from e003556 to 3751add Nov 11, 2019
@forslund

This comment has been minimized.

Copy link
Member

forslund commented Nov 11, 2019

Did a rebase to clean it up but merging now. Many thanks for fixing this!

@forslund forslund merged commit 43e513b into MycroftAI:dev Nov 11, 2019
3 checks passed
3 checks passed
:-) Build finished.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.02%) to 56.021%
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.