[Plugin] Hotword Plugin Free

Search This thread

Humpie

Recognized Developer
Dec 23, 2010
1,421
354
jolanrensen.nl
So now that snowboy is gone is there a way to train a new wakeword?
Yes, you can follow the tutorial at https://github.com/seasalt-ai/snowboy if you're handy enough. Otherwise I'll probably build in the training into hotword plugin myself in a while, but I currently have a lot of exams and deadlines for university, so that will take some weeks.
 

Humpie

Recognized Developer
Dec 23, 2010
1,421
354
jolanrensen.nl
I've been looking into ways to train new hotwords yourself and published a simple website (created by rhasspy) to do so: snowboy.jolanrensen.nl (if the url doesn't work yet, hotwordplugin-image-kmpzomnrva-uc.a.run.app should. The DNS is still updating or whatever).

From my experience the results are not very good however... Even with like 10 samples, which makes sense, since the original Snowboy website had thousands of samples. So, hopefully someone has the time (and money) to host something similar to what Snowboy had before. If all works well for a couple of days,
I'll add a link to my new website in the Hotword Plugin app as well, but I hoped the results would be better...
(Remember there are still some fully trained samples at Github)
 

QuiXilver777

Member
Apr 18, 2018
12
4
I've been looking into ways to train new hotwords yourself and published a simple website (created by rhasspy) to do so: snowboy.jolanrensen.nl (if the url doesn't work yet, hotwordplugin-image-kmpzomnrva-uc.a.run.app should. The DNS is still updating or whatever).

From my experience the results are not very good however... Even with like 10 samples, which makes sense, since the original Snowboy website had thousands of samples. So, hopefully someone has the time (and money) to host something similar to what Snowboy had before. If all works well for a couple of days,
I'll add a link to my new website in the Hotword Plugin app as well, but I hoped the results would be better...
(Remember there are still some fully trained samples at Github)
The website worked perfectly for me, thanks a ton! I was worried I'd have to make a Linux computer and learn how to code better😂😉, I'll probably do that eventually anyway, but now I can spend my time on other more fun things.

The reason I wanted to make my own model was because I have a Galaxy Note 20 and I hated how the wake phrase for Bixby was "Hi Bixby", that is so not natural to say. So I just made a model with "Hey Bixby" instead. So now I'm going to have the plug-in listen for that and trigger Bixby to listen when I say it using Tasker. Oh how beautiful Tasker is.

My next bigg'ish project is to make an app for the Galaxy Watchs like TaskS2 but have it actually work, and be cooler in the process, but that's probably going to take me a few weeks, especially since I need to learn how to make an app like that first. I like Tasker.

I love the app Humpie, great job, I might have some questions for you later if you'll indulge me.
 
  • Like
Reactions: Humpie

QuiXilver777

Member
Apr 18, 2018
12
4
OK, so I can't figure out how to make Bixby start listening. If I simulate the Bixby key press it doesn't continue to listen and I don't know how the phone would know when to stop pressing the button if I have it continuously press the button. I was thinking that I could open the Bixby Voice app with one of its sub-activities, but it says Tasker doesn't have permission. Any help would be greatly appreciated.
 

Humpie

Recognized Developer
Dec 23, 2010
1,421
354
jolanrensen.nl
OK, so I can't figure out how to make Bixby start listening. If I simulate the Bixby key press it doesn't continue to listen and I don't know how the phone would know when to stop pressing the button if I have it continuously press the button. I was thinking that I could open the Bixby Voice app with one of its sub-activities, but it says Tasker doesn't have permission. Any help would be greatly appreciated.
I don't have experience with bixby (since I don't use samsung devices) but maybe the "voice search" action in Tasker can do the trick?
 
  • Like
Reactions: QuiXilver777

QuiXilver777

Member
Apr 18, 2018
12
4
I don't have experience with bixby (since I don't use samsung devices) but maybe the "voice search" action in Tasker can do the trick?
Worked great, thanks. There are so many features and options in Tasker that I'll probably never get through them all, especially with constant updates, not that I'm complaining 😉👌.
 

QuiXilver777

Member
Apr 18, 2018
12
4
I think so! The audio source option lists all the possible audio sources given by the android system, so if your device detects the microphone, of the sources should be the mic you're looking for.
What would it be called? I get the same options whether my headphones are connected or not.
 

Attachments

  • Screenshot_20210226-151512_HotwordPlugin.jpg
    Screenshot_20210226-151512_HotwordPlugin.jpg
    218.8 KB · Views: 6

QuiXilver777

Member
Apr 18, 2018
12
4
I don't know, I think maybe one of the voice ones. Like I said, I just took all of them from the android sdk and listed them in the settings.
Maybe there's an app on the Play store to test all mic types on your device :)
Interesting idea, I'll check, thanks for the effort(that's not sarcasm, I'm sincere) 👍
 
  • Like
Reactions: Humpie

QuiXilver777

Member
Apr 18, 2018
12
4
I tried every mic and none were the headphones. I went into another room and said the hotword, making sure it worked first by saying it next to my phone. Some mics didn't work at all, it said it couldn't get microphone access from the background, while the app was in the foreground. The same kinda thing happened with an app I used to test the microphones like you suggested. Are certain mics off limits to regular apps?
 

Humpie

Recognized Developer
Dec 23, 2010
1,421
354
jolanrensen.nl
I tried every mic and none were the headphones. I went into another room and said the hotword, making sure it worked first by saying it next to my phone. Some mics didn't work at all, it said it couldn't get microphone access from the background, while the app was in the foreground. The same kinda thing happened with an app I used to test the microphones like you suggested. Are certain mics off limits to regular apps?
I think if the microphone type selected is unavailable it will respond with that message (usually this is when the app is in the background and it tries to access the mic, hence the message). These are all the types available to me: https://developer.android.com/reference/android/media/MediaRecorder.AudioSource
 

QuiXilver777

Member
Apr 18, 2018
12
4
I think if the microphone type selected is unavailable it will respond with that message (usually this is when the app is in the background and it tries to access the mic, hence the message). These are all the types available to me: https://developer.android.com/reference/android/media/MediaRecorder.AudioSource
So I read this,
"VOICE_CALL

Voice call uplink + downlink audio source

Capturing from VOICE_CALL source requires the Manifest.permission.CAPTURE_AUDIO_OUTPUT permissio n."

Does that mean I can give that permission to the Hotword Detection app with an ADB command and it will have access to that audio source?
 

Humpie

Recognized Developer
Dec 23, 2010
1,421
354
jolanrensen.nl
So I read this,
"VOICE_CALL

Voice call uplink + downlink audio source

Capturing from VOICE_CALL source requires the Manifest.permission.CAPTURE_AUDIO_OUTPUT permissio n."

Does that mean I can give that permission to the Hotword Detection app with an ADB command and it will have access to that audio source?
Oh I think this mic is actually for voice call recording... And that permission apparently is not for 3rd party apps according to Android Developers. So, I don't think that one would so the trick (and I might actually remove it since it requires a permission my app cannot ask for lol)
 

QuiXilver777

Member
Apr 18, 2018
12
4
Oh I think this mic is actually for voice call recording... And that permission apparently is not for 3rd party apps according to Android Developers. So, I don't think that one would so the trick (and I might actually remove it since it requires a permission my app cannot ask for lol)
So I can't just give it permission with an ADB command?
 

Humpie

Recognized Developer
Dec 23, 2010
1,421
354
jolanrensen.nl
So I can't just give it permission with an ADB command?
No, the app needs to specify which permissions it wants. But apparently the voice mic sources are for call recording anyways, so they're not useful. So "Default", "Mic", "Unprocessed", and "Camcorder" are the ones to try. If none of those work I'm afraid you're out of luck. I did get it to work once with a usb microphone however, but I never tried it via bluetooth. I think bluetooth requires hooking into a call-service or something, so make sure it connects to it like a headset. Not something that's currently present in the app or that I have the time for at the moment to figure out if it's even possible with the Snowboy hotword recognition etc.
Might look at it in the future though :)
 

QuiXilver777

Member
Apr 18, 2018
12
4
No, the app needs to specify which permissions it wants. But apparently the voice mic sources are for call recording anyways, so they're not useful. So "Default", "Mic", "Unprocessed", and "Camcorder" are the ones to try. If none of those work I'm afraid you're out of luck. I did get it to work once with a usb microphone however, but I never tried it via bluetooth. I think bluetooth requires hooking into a call-service or something, so make sure it connects to it like a headset. Not something that's currently present in the app or that I have the time for at the moment to figure out if it's even possible with the Snowboy hotword recognition etc.
Might look at it in the future though :)
You might be able to access it apart from the hotword recognition and just relay it to the hotword recognizer, kinda like the app Buttons for Alexa. I haven't gotten too far into learning coding or making apps, although I'll get to it soon, so if this is irrelevant information then just ignore me. Either way I hope you can find time to figure that out, I wanted to trigger Tasker tasks while away from my phone, and maybe mess with some external microphones attached to one of my spare phones so I can trigger tasks from anywhere. Anyway, I have a lot of ideas that will probably never happen, but it's fun to imagine them anyway😉.
 
  • Like
Reactions: Humpie

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Isn't everyone using this plugin already heavily invested into Tasker which uses the accessibility service too? Wouldn't that mean it's not that big a difference?

    ATM I have no other ideas to make it a system app. Magisk systemize module doesn't show HWP. Copying the apk to /system/app/ isn't possible, even with root. TiBa with root doesn't get the job done either. I'm wondering if it's not an Android 11 prohibition.

    BTW, don't you run into problems with OTA updates once you've systemized an app?
    As long as you use Magisk to systemize an app you're fine. Magisk modules are applied at boot.

    Edit: I found out systemizer doesn't work well for converting user installed apps if your data partition is encrypted. All folder names in /data/* are scrambled, so systemizer cannot find the apk. It might still work with a separate apk.
    1
    I've tried installing it as user app alongside a system app, installing it to /system/priv apps/ instead of /system/apps/, but nothing helps. HWP always stops immediately before showing any screen. After the second try, Android gives the "app keeps stopping" dialogue.

    For now I'll use it as normal user app and automate turning it on with AutoInput. I hope you find time to make things better in the future.
    1
    Some advise from the Tasker subreddit https://www.reddit.com/r/tasker/comments/miurdl/_/gt8gtec Ask the dev to give the app SYSTEM_ALERT_WINDOW permission, this will allow it to operate in the background; which is likely a cause (in newer Android, apps are limited what they can do in background).
    1
    Some advise from the Tasker subreddit https://www.reddit.com/r/tasker/comments/miurdl/_/gt8gtec Ask the dev to give the app SYSTEM_ALERT_WINDOW permission, this will allow it to operate in the background; which is likely a cause (in newer Android, apps are limited what they can do in background).
    Put it on my to do list, but again, don't have time atm. Thanks for letting me know
    1
    Just a FYI, I've found a workaround. I can use an event profile that listens to what HotwordPlugin produces in the logcat.

    So I'm back in business again.
  • 14
    Hi everyone!
    After my first plugin I had an idea of creating another one, but this time not an "action" but an "event".

    The free but ad-supported version of the plugin can be found here and if you want to support the development and don't have ads you can find the paid one here.

    Of course the description can be found there, but as a quick recap, this plugin can listen for hotwords and signal Tasker when a hotword is recognized!
    It uses Snowboy Hotword to listen to the mic and process what it hears super fast and completely locally.
    Hotword models can be found and trained at the Snowboy Website and the downloaded model can be imported in my plugin.
    Next from Tasker you can create an event of the Hotword Plugin and tap on the hotword you want to react to, next you can do with it what you want!
    You can listen to multiple hotwords at the same time and run a different event for each one. So for example if you shout "lights on" the lights might turn on and if you shout "play music" the music starts playing.
    You can see it as AutoVoice Continuous but a lot faster and more consistent, plus you can train any hotword you like and pronounce it in any language you prefer (to be defined at the website).
    Of course you can modify the sensitivity if you feel like it can't hear you or if it goes off all the time and you can start or stop the service via a Tasker action if you like.
    Personally I use the app in combination with my ADB shell plugin to launch assistant on my NVIDIA Shield AndroidTV handsfree by shouting "hey google" to an old android phone lying besides the tv.

    Since a lot of time went into developing this plugin and making it work (a way lot more than my last plugin) I put it in the Play Store for the price of a small coffee but since I know people like free apps, I decided to also create an add supported version.
    Again, you can find the free version here and the ad-free version here (Of course I will update both at about the same time when I fix something).
    So if you like the idea and want to try it out please have a look!
    And if you have any questions, troubles, ideas, bugs (yes I'm sure they're there even after thoroughly testing), please leave them below!

    Edit: If you don't have access to the Google Play store, I just uploaded both versions to XDA Labs:
    Paid version
    Free version
    4
    I've released stable version 2.0!
    From the latest beta I've
    -fixed the toast bug (thanks @sherdog16)
    -added ability to disable hotwords (thanks @geigervibe)
    -renamed/resized/redesigned some stuff so it should work better on all screen sizes
    Thanks for all your help!
    Now I can work again on my other apps (if you like the Harry Potter 2 Weasley clock, be prepared)
    3
    New release! v1.4

    - Added toast toggle
    - Added ability to stop service after single hotword detection (saves you a step in Tasker)
    - Listening toggle now updates live
    @Desmanto This one is for you, thanks again for the ideas
    3
    I've been looking into ways to train new hotwords yourself and published a simple website (created by rhasspy) to do so: snowboy.jolanrensen.nl (if the url doesn't work yet, hotwordplugin-image-kmpzomnrva-uc.a.run.app should. The DNS is still updating or whatever).

    From my experience the results are not very good however... Even with like 10 samples, which makes sense, since the original Snowboy website had thousands of samples. So, hopefully someone has the time (and money) to host something similar to what Snowboy had before. If all works well for a couple of days,
    I'll add a link to my new website in the Hotword Plugin app as well, but I hoped the results would be better...
    (Remember there are still some fully trained samples at Github)
    2
    This might be a silly question but if your app locks up the microphone how can I talk on the phone if someone calls me?
    create a new profile based on event picking up calls, make it switch off service.
    create another one with state phone idle, make it turning service back on, or maybe combining by using its exit task to turn off service.
    I would prefer 2 different profiles for the sake of stability, but try each it first and decide for yourself:)
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone