Melvin-Abraham / Google-Assistant-Unofficial-Desktop-Client

A cross-platform unofficial Google Assistant Client for Desktop (powered by Google Assistant SDK)
Apache License 2.0
3.58k stars 398 forks source link

Wake Word detection #497

Open adhitht opened 2 years ago

adhitht commented 2 years ago

I have downloaded g-assist from snap store version 1.0.0-rc.2. Wake word doesn't seem to work. (I am not sure if it is built for the version) Please clarify. Saw that wake word detection is built using bumble-bee. I have tried bumble-bee from here : https://jaxcore.github.io/bumblebee-hotword/full-example/. I have tried hey_google and ok_google. But bumble-bee doesn't seem to recognise both. (Had 1 recognition with almost 20 tries :disappointed: ). Alexa seems to hear me. It would to be better if you could just provide option to set other wake-words in settings. I would also suggest teachable machine from google as an alternative to bumble-bee. (It works very well.) Hope you could implement that well. Teachable machine can be customised to user so recognition will be far more effective. https://teachablemachine.withgoogle.com/ snowboy is another depreciated software which can be used to have wake-word detection.

im-coder-lg commented 2 years ago

Build from the codebase via NPM, and the wakeword will work. Since the new release isn't out yet(but will be soon) you will have to build it from source. Get Git and Node JS 16, clone the repo in a folder(random) and run the commands listed in the Readme. Then, open the newly-created dist folder and you might have to check that. Run the installer there(you bult it so you are secure) or check the linux-unpacked(doubt here but unpacked confirmed) folder and run the Google Assistant executable for Linux. Then, you are good to go.

im-coder-lg commented 2 years ago

Teachable machine can be customised to user so recognition will be far more effective. https://teachablemachine.withgoogle.com/

Wow, @Melvin-Abraham this is a good idea, right? Bumblebee currently can't recognise Ok Google or Hey Google, which means you have to release a little(in my case, a lot) sound, but if we try integrating this, it might recognise Hey Google/Ok Google perfectly, right?

im-coder-lg commented 2 years ago

Bumblebee currently can't recognize Ok Google or Hey Google,

Sorry for that... It was actually: Bumblebee currently can't recognize Ok Google/Hey Google quickly or in one sentence, ie. Ok Google.

adhitht commented 2 years ago

Bumblebee currently can't recognize Ok Google/Hey Google quickly or in one sentence,

Well keyboard shortcut would be better than that.

Melvin-Abraham commented 2 years ago

I tried some other wake words in bumblebee which seem to work much better. Maybe these could be provided as possible wake-word options...

Melvin-Abraham commented 2 years ago

Teachable machine can be customised to user so recognition will be far more effective. https://teachablemachine.withgoogle.com/

Wow, @Melvin-Abraham this is a good idea, right? Bumblebee currently can't recognise Ok Google or Hey Google, which means you have to release a little(in my case, a lot) sound, but if we try integrating this, it might recognise Hey Google/Ok Google perfectly, right?

This would require a ton of voice data from a number of people with different accents and dialects. If it is trained with a small sample group, it would perform worse for other set of people...

So, my plan for now is to keep using bumblebee with extended functionalities for this release. If that doesn't suffice, maybe we can give it a thought

adhitht commented 2 years ago

You can download dataset for one person,so it can be stored at a particular location and accessed by the app. So it will work perfectly for one user.

im-coder-lg commented 2 years ago

hey, why not keep one audio file for the voice recog(recognition)? We can use the same way Androids ask for Ok Google and Hey Google twice, right? Can that work?

adhitht commented 2 years ago

Did not get what you are talking about. Let me clarify, with teachable machine you have to record background voice and a class, as we are intended to make a wake word, we have to repeatedly say something like Ok Google, or Hey Google, (or both together) and it should be minimum 8 samples for class. At last we have to train model and export data, it gives some zip file with almost a few kilobites of data (two json files and a bin file). We could use them to trigger wake word. So the audio samples have to be collected by user and add it in a directory and make g-assist read that. (Same as in the case of tokens and credentials file). It would be awesome if you could implement that.

Melvin-Abraham commented 2 years ago

I am not sure if teachable machine is a perfect candidate for this use-case. If I am not wrong, it is best fit for distinguishing different quality/types of sounds, different timbre, tones, etc. but not fit for a wake-word detection as it could lead to a plethora of false-positives or false-negatives which could possibly trigger the assistant every-so-often if not trained properly. Also, that might require more than 500 to 1000+ (not a calculated guess) samples for both random noise (false triggers would mostly depend on this) and wake-word classes just for a single person for it to even perform properly which would require a lot of training, thus, space and time overhead. That's just my opinion though...

im-coder-lg commented 2 years ago

I say copying the Android Google Assistant Voice Detection setup might work. Two Ok Google audio files and two Hey Google Audio files or just go get them from the global Google Account since they are stored on the Google Account.

Wizards-god commented 2 years ago

Is the wake word available for Windows 10 or is it just for Linux.

sumeshir26 commented 2 years ago

@Wizards-god It is there for Windows as well

Wizards-god commented 2 years ago

@sumeshir26 But it does not activate when i say Ok Google or Hey Google or Bumblebee So can you tell me what the wake word is.

im-coder-lg commented 2 years ago

Did you build it in the first place?

Wizards-god commented 2 years ago

Build what.

im-coder-lg commented 2 years ago

the app

im-coder-lg commented 2 years ago

Do you know how to build it?

Wizards-god commented 2 years ago

The bumble bee app you mean?

Wizards-god commented 2 years ago

No i dont actually know how to build it

im-coder-lg commented 2 years ago

The GAUDC app.

Wizards-god commented 2 years ago

Could you tell me how to build it.

Wizards-god commented 2 years ago

I have the google assistant app

im-coder-lg commented 2 years ago

You have to build the entire app. Don't worry, it is easy but will take time.

Wizards-god commented 2 years ago

Ok can you guide me through it

im-coder-lg commented 2 years ago

Alright, time for some tech gobbledygook.

  1. Go to https://nodejs.org, get Node JS 14.17, and get Git from https://git-scm.org. Install the software.
  2. Hit Windows + R
  3. Type cmd
  4. Hit Enter
  5. Type cd Desktop
  6. Now, enter this string: git clone https://github.com/Melvin-Abraham/Google-Assistant-Unofficial-Desktop-Client.git(that's why you need Git, to clone the entire code)
  7. type this: cd Google-Assistant-Unofficial-Desktop-Client
  8. type this: npm install && npm run dist(That's why you need Node JS, it downloads NPM with it, which in turn helps you to install dependencies)
  9. Then, run this in CMD: explorer
  10. That opens the Windows Explorer. Now, go to Desktop and then, Google-Assistant-Unofficial-Desktop-Client.
  11. Go inside the dist folder and then, win-unpacked.
  12. Run the Google-Assistant.exe file and GAUDC will launch. Note: Make sure your old GAUDC is successfully closed.
Wizards-god commented 2 years ago

Can i uninstall node and git after the procedure?

im-coder-lg commented 2 years ago

Then, authenticate it(I expect you know how by now) and go to Settings. Locate Ok Google and toggle it.

Can i uninstall node and git after the procedure?

If you want. However, I suggest that you don't because the compiled version has bugs. After the new release, new bugs+fixes will be released, so don't uninstall it, use it for GAUDC and if you ever need to make a project like it, NPM will help you. Since new bugs are found almost everyday, and fixes are released, you will lose the fix, so you can build it from the code base whenever you find bugs that are already fixed.

Wizards-god commented 2 years ago

Ok thanks for all the help will try and let you know.

im-coder-lg commented 2 years ago

:+1:

Wizards-god commented 2 years ago

Why is node installing visual studio?

Wizards-god commented 2 years ago

I thought it was only node.

im-coder-lg commented 2 years ago

I think it needs it. You mainly need Git, Node JS, and Visual Studio's build tools(?) and Windows Build Tools.

Wizards-god commented 2 years ago

Oh ok then.

im-coder-lg commented 2 years ago

I am unsure on Visual Studio but I know that you need Windows Build Tools.

Wizards-god commented 2 years ago

image It is stuck at this page from the past 6 mins. Could you please tell me why.

im-coder-lg commented 2 years ago

Oh no. You have Windows 11. But did you get Node JS?

Wizards-god commented 2 years ago

I got Git but that screen is that of Node JS

im-coder-lg commented 2 years ago

Close that. And open Command Prompt or Windows Terminal

Wizards-god commented 2 years ago

Ok

im-coder-lg commented 2 years ago

Follow those commands I put above only. It is also in the README

Wizards-god commented 2 years ago

I tried entering cd Desktop in cmd but it says the system cannot find the specified path

im-coder-lg commented 2 years ago

type dir and send me the screenshot. I don't use Windows 11 so idk about the path.

Wizards-god commented 2 years ago

image Ok and i see that the desktop folder is in the OneDrive Folder

im-coder-lg commented 2 years ago

Okay... Desktop is gone... Type cd Documents, everything else is the same.

Wizards-god commented 2 years ago

ok will try that

Wizards-god commented 2 years ago

Could you please explain to me from the 10th step. I did not understand

sumeshir26 commented 2 years ago

Go to your desktop

sumeshir26 commented 2 years ago

Hover at the right side of your taskbar and press the line that appears there

Wizards-god commented 2 years ago

ok