Skip to content
This repository was archived by the owner on Sep 8, 2024. It is now read-only.

Refactor wake-word waiting and record phrase #2589

Merged
merged 6 commits into from
May 31, 2020

Conversation

forslund
Copy link
Collaborator

Description

The wake-word waiting and record phrase methods mixed a lot of logic with maths and were reported as high complexity methods, this separates the math out from the methods keeping the logic.

  • Wakeword returns a data tuple withe the result state to be able to perform post operations outside
  • Simple data structures for cyclic mean and cyclic data collection was added
  • End of sentence tracking was extracted from the phrase recording into a separate class

How to test

Check that unit tests all pass and that Mycroft can still wakeup and process audio.

Contributor license agreement signed?

CLA [ Yes ]

@devs-mycroft devs-mycroft added the CLA: Yes Contributor License Agreement exists (see https://github.com/MycroftAI/contributors) label May 18, 2020
@forslund forslund force-pushed the refactor/speech-client branch from cb39ab2 to d3d48be Compare May 18, 2020 12:47
@devops-mycroft
Copy link

Voight Kampff Integration Test Succeeded (Results)

Copy link
Member

@chrisveilleux chrisveilleux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing really major, just some additional refactoring.

@forslund forslund force-pushed the refactor/speech-client branch 2 times, most recently from 53ec1b0 to e8b0399 Compare May 21, 2020 08:59
@forslund
Copy link
Collaborator Author

I think I've handled most of the comments here. I'm investigating if there's a small logic issue. Feel free to re-review but don't merge just yet

@devops-mycroft
Copy link

Voight Kampff Integration Test Succeeded (Results)

@forslund forslund force-pushed the refactor/speech-client branch from e8b0399 to 45bbc0a Compare May 21, 2020 09:58
@forslund
Copy link
Collaborator Author

Did find and correct a small logic thing when checking the sentence completion, it was missing a check for the 0.25 sec of quietness.

@devops-mycroft
Copy link

Voight Kampff Integration Test Succeeded (Results)

@devops-mycroft
Copy link

Voight Kampff Integration Test Failed (Results)

@devops-mycroft
Copy link

Voight Kampff Integration Test Succeeded (Results)

@forslund forslund added the Merge after next release For large changes that look good, but we want to keep in Dev a little longer label May 26, 2020
forslund added 6 commits May 26, 2020 12:12
- Add RollingMean data structure
- Add simple CyclicBuffer data structure
- Move out post find actions into separate method
- Return the data from the wakeword as a tuple.
- Extract post wakeword actions from wait for wakeword method
Move wakeword duration to the wakeword engine since all wakeword engines
doesn't really use phonemes
The function is based on the parameters of the Mic and is much more a
method of the mic than a static function
_record_phrase now uses a helper class to track the noise in a sentence
to determine when the user has stopped speaking.

The logic should be the same but the same but allow for easier testing
and manipulation.
@forslund forslund force-pushed the refactor/speech-client branch from 45bbc0a to 926d3ff Compare May 26, 2020 10:12
@devops-mycroft
Copy link

Voight Kampff Integration Test Succeeded (Results)

@forslund forslund merged commit 1614590 into MycroftAI:dev May 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA: Yes Contributor License Agreement exists (see https://github.com/MycroftAI/contributors) Merge after next release For large changes that look good, but we want to keep in Dev a little longer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants