wrapper for Snowboy: a hotword detection engine

inakigarm

Well-Known Member
Licensed User
Longtime User
Don't know. In my phone (Android 6.0.1) if I run this app after installing it hangs.I have to manually approve the permissions in Settings to run the App.
 

DonManfred

Expert
Licensed User
Longtime User
So i guess it is a device specific issue!?
Ok, i count it as it does work. ;)
 

DonManfred

Expert
Licensed User
Longtime User
1. Could this have to do with the fact that it has been optimized for one particular voice?
Maybe. Probably. If you go on https://snowboy.kitt.ai/dashboard and you filter the list... you´ll find public hotword with x samples.
2. How can I train it to my voice (where is the link with the webinterface)?
See the Dashboard above. If you are logged in you can create new hotwords and speak samples. Unfortunately it does not work here as i dont have a microphone connected to my pc as yet.
3. Why is this APK recording all the time?
This is how the library works. you can start and stop the recording... if you started it then it is running (thread) and trying to capture a hotword
4. Who made this APK?
This is a prolem here in the thread. I posted a example apk in post #2
Johan posted a sample in another post. WHICH of the two you are using?
 

Johan Schoeman

Expert
Licensed User
Longtime User
Maybe. Probably. If you go on https://snowboy.kitt.ai/dashboard and you filter the list... you´ll find public hotword with x samples.

See the Dashboard above. If you are logged in you can create new hotwords and speak samples. Unfortunately it does not work here as i dont have a microphone connected to my pc as yet.

This is how the library works. you can start and stop the recording... if you started it then it is running (thread) and trying to capture a hotword

This is a prolem here in the thread. I posted a example apk in post #2
Johan posted a sample in another post. WHICH of the two you are using?
@DonManfred, both yours and mine are running on my S4 mini. I will try both our APK's on my Lollipop and Marshmallow devices.
 

DonManfred

Expert
Licensed User
Longtime User
You really should quote the post you are answering to as i now am unsure if you answer to my or to johan
Let´s talk about the apk in post #2, my.
It is a b4a project with basically the code as seen in this post.
It is using a librarywrap that i wrote for the Snowboy-Recognition .so files

I.e. I would like the "pling" (plus toastmessage) to trigger Google's speech recognition in my app.
If you are recording and the detector detects one of the hotwords, it raises an Event in your app.

Example:
Here i am initializing the detector with all hotword-umdl files i have

*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
wcl.Initialize(wcl)
ListFilesAndFolders(/storage/emulated/0/snowboy,*.umdl)
Filelisting.Size = 11
Dirlisting.Size = 0
** Activity (main) Resume **
wcl_FilesAndFoldersFinish(0,11)
alexa.umdl
barrier.umdl
chris.umdl
Extreme.umdl
hello.umdl
OK_Google.umdl
pilot.umdl
Pluto.umdl
smart_mirror.umdl
snowboy.umdl
stitch.umdl
======================
======================
/storage/emulated/0/snowboy/alexa.umdl,/storage/emulated/0/snowboy/barrier.umdl,/storage/emulated/0/snowboy/chris.umdl,/storage/emulated/0/snowboy/Extreme.umdl,/storage/emulated/0/snowboy/hello.umdl,/storage/emulated/0/snowboy/OK_Google.umdl,/storage/emulated/0/snowboy/pilot.umdl,/storage/emulated/0/snowboy/Pluto.umdl,/storage/emulated/0/snowboy/smart_mirror.umdl,/storage/emulated/0/snowboy/snowboy.umdl,/storage/emulated/0/snowboy/stitch.umdl
======================
======================
Snowboy initialized with 11 Hotwords...
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
--G-> recording started ...
--G-> Detected 1 times
Snowboy_onHotword(5 -> hello)
--G-> Detected 2 times
Snowboy_onHotword(10 -> snowboy)
--G-> Detected 3 times
Snowboy_onHotword(1 -> alexa)
--G-> recording stopped
record.pcm is 764800

I.e. I would like the "pling" (plus toastmessage) to trigger Google's speech recognition in my app.
So it is up to you to start a Google speech triggering if ou know how to do
In my example i just LOG something...
B4X:
Sub Snowboy_onHotword(hotword As Int)
    Log($"Snowboy_onHotword(${hotword} -> ${hotwords.Get(hotword-1)})"$)   
End Sub
 

Johan Schoeman

Expert
Licensed User
Longtime User
Thank you very much. I am using your APK.
I assume you made it? If so, how can it be implemented in another B4A project? I.e. I would like the "pling" (plus toastmessage) to trigger Google's speech recognition in my app.
Isn't it possible to convert your (or Johan's) APK to a B4A library (or class), or is the APK (just) an experiment?

I really appreciate all this good work. For ages I have been looking for a hotword solution. This "Snowboy" seems to have potential.
Syd, mine is just for experimental purposes and I have sent my code on to @DonManfred as there are things that I have found out about incorporating this into a B4A library and then what @DonManfred has found out. @DonManfred is doing a fully fledged B4A wrapper that I guess he will post when he is ready to do so. No simple task - believe me. I spent most of the day yesterday to sort out 2 x Java classes (no code whatsoever) and searched for the "missing" .so file. And then created about 6 to 8 umdl files that recognizes what I say when I start the app. I have had very very few misinterpretations on the hot words that I am using in my shortcut wrap.

But as what I have said - @DonManfred is busy with this and sure he will sort it out.;). And if I were him I will make it chargeable - there have been hours and hours between us that has gone into this.
 
Last edited:

Johan Schoeman

Expert
Licensed User
Longtime User
My APK crashes on my Samsung Grand Galaxy Prime+ with Marshmallow. Found this in the unfiltered logs:

mkdir failed: /storage/emulated/0/snowboy//

So I guess it has to do with the "path" of the folder that is created and where exactly it is. We all know how consistent Android is in their naming/path conventions....
 

DonManfred

Expert
Licensed User
Longtime User
or am I overlooking something
If you mean a library itself? No, you did not missed it. It is not released as yet.
I wrote the wrap because of the JOBOFFER this thread belongs too. :D
If it get into the stage i get paid for my work then i´ll - MAYBE - release it in public too.
"If you want to finish first you have to finish first" :D
Ok, i must check what the problem is with his S8. Unfortunately i don´t have one.
So far i can see it does not work on the TOs device. It crashes.
 

Johan Schoeman

Expert
Licensed User
Longtime User

DonManfred

Expert
Licensed User
Longtime User
Ok, after enabling the permissions, it works now.
Ohh, great.

Also, can you please try for the word "extreme" ? Because that's the hotword I will be implementing. Want to see how accurate it is. https://snowboy.kitt.ai/hotword/10208
i can only download a word if i add my own voice for it.
Do you have an umdl file which i could use?

On the other hand i´m preparing a Trial version of my Library. You can try add your own udml files which you can download from their website...
That´s the plan :D
 
Top