Android Question How to embed Google Assistant in a B4A app

Discussion in 'Android Questions' started by Syd Wright, Jul 16, 2019.

  1. Syd Wright

    Syd Wright Active Member Licensed User

    I would like to embed the Google Assistant in one of my apps.
    It seems possible with Google's SDK, using the "Google Assistant Service":
    https://developers.google.com/assistant/sdk/overview
    Has anyone tried to implement this SDK? Any tips how to proceed?

    NB: Google only allows the use of this SDK for non-commercial use.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    It is not an Android SDK. It will be difficult to integrate it.
     
    Syd Wright likes this.
  3. MarkusR

    MarkusR Well-Known Member Licensed User

    you need it for voice input?
     
  4. Syd Wright

    Syd Wright Active Member Licensed User

    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...
     
  5. kent

    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)
     
  6. Syd Wright

    Syd Wright Active 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.
     
  7. kent

    kent Member Licensed User

    Hi Syd Thanks for your response - it seems like the technology is not yet ready for mainstream/easy use.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice