Skip to content

Allow users to import a custom wake word model - #291

Merged
Stypox merged 10 commits into
DicioTeam:masterfrom
celskeggs:cskeggs-patch-3
Mar 30, 2025
Merged

Stypox merged 10 commits into
DicioTeam:masterfrom
celskeggs:cskeggs-patch-3

Conversation

@celskeggs

@celskeggs celskeggs commented Feb 21, 2025 •

Copy link
Copy Markdown
Contributor

While I can recompile Dicio myself to replace the wake word... it would be really nice if users could use a custom wake word more easily. This PR adds the ability to import a .tflite file to override the default downloaded "Hey Dicio" wake word.

Generating a custom wake word is out of scope for the app, but users can download a model from the Home Assistant collection or use the OpenWakeWord scripts for training on Google Colab.

Fixes #289 #275 #238

It is still necessary for users to generate the wake word model on
their own, but now it is not necessary to recompile the app to use it.
This allows the UI layer to listen to changes
@Stypox

Stypox commented Feb 27, 2025 •

Copy link
Copy Markdown
Collaborator

I pushed a few commits which:

  • fix some synchronization issues in the OpenWakeWord model
  • avoid having the view model access the specific wake word device instance (which may be recreated at any time)
  • make the methods to handle the custom model file static, so they can be used independently of the current wake word device
  • make it so that the text in the notification changes from Listening for the "Hey Dicio" wake word to Listening for custom wake word automatically
  • improve the strings a bit and add some suggestions on where to download the models

Other than that, thank you for this PR! The general approach was good, but I had to make some of the above changes to make the code modules more well separated and generalized.

Debug APK: https://github.com/Stypox/testing-apks/releases/download/13/app-debug.apk (can be tested with models downloaded from https://github.com/dscripka/openWakeWord/releases/ )

- avoid having the view model access the specific wake word device instance (which may be recreated at any time)
- make the methods to handle the custom model file static, so they can be used independently of the current wake word device
make it so that the text in the notification changes from `Listening for the "Hey Dicio" wake word` to `Listening for custom wake word` automatically
Comment thread app/src/main/kotlin/org/stypox/dicio/io/wake/oww/OpenWakeWordDevice.kt Outdated
@Ram-Z Ram-Z mentioned this pull request Mar 2, 2025
@Stypox
Stypox merged commit 30dae94 into DicioTeam:master Mar 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multiple built-in wake words and/or import custom wake word

2 participants