Android Question How to embed Google Assistant in a B4A app

MarkusR

Well-Known Member
Licensed User
you need it for voice input?
 

Syd Wright

Well-Known Member
Licensed User
you need it for voice input?
Yes, indeed. I already have made a Personal Assistant app that has its own (huge) database. It uses Snowboy to process a Hotword (library can be found in the forum) and subsequently accesses Google voice recognition to get the plain text of a spoken command or question. The idea is to add Google Assistant features, but only for questions and tasks that my own app can't handle.

The Google Assistant nowadays is being added to so many devices (smart speakers, wearables etc) that I am surprised that not more forum members are interested in implementing this technology into their apps...
 

kent

Member
Licensed User
Hi Syd,

Your project:
”It uses Snowboy to process a Hotword (library can be found in the forum) and subsequently accesses Google voice recognition to get the plain text of a spoken command or question.”


Sounds more or less as the same project I´m planning to make.(just not a personal assistant) (Right now I use google to translate speech to text, but I like a hotword and not a button to start “listening”)


But I have not succeeded to get Snowboy to work yet.

Are you using Snowboy b4a library version 0.36 or version 0.5 ? (or does there exist a newer)

I have tried numerous examples I could find in the forum, but without luck. I don’t know if the library very unstable, or it is my phone (Samsung A3) or the way it is used. (it crashes without any useful debug information)
 

Syd Wright

Well-Known Member
Licensed User
Hi Kent,

Snowboy works reasonably well. It does require using the .umdl files ("Alexa", "Computer", "Jarvis" etc.). You can find them on the Snowboy website. I tried using my own .pmdl files (created via their website), which work OK for me, but they work poorly with other people's voices.

What needs further improvement is that the Hotword is triggered too often falsely on the basis of random sounds in the room. Also it stops listening to the Hotword after a random interval (from 10 minutes to a number of hours) on Android 8+ devices. I assume some parts of Snowboy get killed by the OS (although it doesn't seem to use a service). I have spent days trying to find the cause or workarounds, but failed. There is no problem on Android 7 or older devices.

Don Manfred made the wrapper. Contact him for further advice. Also forum user Multiverse uses Snowboy for his "Extreme" app.

I am using version 0.50 but did use a more recent version of the .SO file that also has 64bit capability (otherwise the Google Playstore will refuse your app, since August). I forgot where I found this .SO file, but search the Forum: somebody told Multiverse where to find it.

In conclusion: Snowboy does the job, but not as good as "Hey Google" or "OK Google", and the user needs to realise that he/she has to wait for a beep before speaking the actual question or command after saying the hotword (because you need Google to handle this). Snowboy works far better than Pocketsphinx which I don't recommend.
 

kent

Member
Licensed User
Hi Syd Thanks for your response - it seems like the technology is not yet ready for mainstream/easy use.
 
Top