The Google Assistant is enabled on almost all newly manufactured Android phones, but nowadays there is no desktop version available. Despite this, today I will show you a method ( something tedious ) to get Google Assistant to work on your Windows machine.
At the time of writing this post, there is no fancy graphical user interface for what we are about to do, and the installation will be based mainly on command lines. But once I get it up and running, you can speak into your computer's microphone just like you would your Android device to control the Google Assistant.
Requirements
First, you must install Python on your computer and later we have to add it to the path, follow me carefully. Download and run the Python .exe installer and have it do a custom install . On the second screen of alternatives, Mark “Add Python to environment variables”.
Once Python is installed, open a command terminal and type “python” (without quotation marks). If everything goes fine, the command line should show your current version of Python.
Now we need to configure the Google Assistant API.
-
Navigate to the projects page in the Google cloud platform console.
-
Click »Create Project» above.
-
Give the project a name like »Google Assistant» and click «Create».
-
The console will create your new project; you should see a rotating progress icon in the top right. When I finish, you will be directed to the project settings page.
-
Go to the Google Assistant API page and click “Enable” at the top. “
-
To use the API, you will need to create credentials. Then click the button “Create credentials” in the upper right. A setup wizard will guide you through this procedure.
-
On “From where will you call the API?”, Please select “Other user interface (as an example, Windows, CLI tool)”. In order to “What data are you going to enter?” select the circle »User data«. Now click on “What credentials do i need?”
-
Google will recommend that you create an OAuth client ID 2.0. Give the customer ID a unique name and click “Create Customer ID”.
-
On “Product name displayed to users”, enter “My Google Assistant” or something like that.
-
Click 'done', but don't click download here, we only need the client's secret.
-
In the OAuth client ID listing 2.0, you will see the customer ID you just created. On the far right, click the download icon to download the client_secret_XXX.json file, where $ 0027XXX $ 0027 is your customer ID. Save this file anywhere on your computer, ideally in a new folder called “Google Assistant”.
-
Go to the activity controls page of your Google account and make sure that “Web and app activity”, “Location history”, “Device Information” Y “Voice and audio activity” are activated. This is so the Google Assistant can read your personalized information.
Now we need to configure a client that accesses the Google Assistant API.
Open a command terminal and type the following command:
-m pip install google-assistant-sdk[samples]
This will start to install the required dependencies for Python. When I finish, enter this command below (change directory path in command).
py -m googlesamples.assistant.auth_helpers --client-secrets changeyourpathconecret_client_XXX.apps.googleusercontent.com.json
On the command line, you will be shown a URL that you must visit to authorize the application. Go ahead and copy the URL into your browser and use the same Google account that you used to configure the Google Assistant API. You will be shown an access token for your client; copy access token at command prompt when prompted.
Now we will test if the Google Assistant can correctly enter your microphone. Type at the command prompt:
python -m googlesamples.assistant.audio_helpers
If you play some audio correctly, you can start communicating with the Google Assistant. Type at the command prompt:
python -m googlesamples.assistant
Wait for me to say “press Enter to submit a new request”, then press Enter on your keyboard to start speaking into your microphone. When i finish talking, the command prompt will display a transcript of what you said and will also reproduce the Google Assistant solution.
Now, the above command line is a pretty ugly method to interact with the Google Assistant API, but luckily there is an extension for the Chrome browser called »AutoVoice» that simply requires you to have the Google Assistant configured on your computer (what we just did !). Despite this, we'll need to do a bit more command magic to set it up correctly.
Open command prompt and copy the following command:
py -c "from distutils.sysconfig import get_python_lib; from urllib.request import urlretrieve; urlretrieve($0027https://joaoapps.com/AutoApps/Help/Info/com.joaomgcd.autovoice/googleassistant/__main__.py$0027, get_python_lib() + $0027/googlesamples/assistant/__main__.py$0027)"
Now navigate to the AutoVoice extension page with the Google Chrome browser and install it. In the extension alternatives, set the wake command to something like “Hey Google” u “Okay Google” or what you really want.
Enable the option »Always listening» and set the »Activation expression» to something other than what you have configured as the activation command. Remember: an expression is to awaken the extension , the other expression is to wake up Google Assistant .
Now type your command line:
py -m googlesamples.assistant
Now you can just say “¡Ok Google!” or whatever you put as an expression to wake up the Google Assistant and immediately start giving it commands ( “Ok Google, How is the weather today?” )
Related Post:
- ▷ What is “Modern Setup Host” and how to fix high disk usage by “Modern Setup Host”?
- ▷ How to fix Minecraft server connection timeout error on Windows?
- ▷ What is nvbackend.exe and how to fix it?
- NVIDIA Code 43 (Windows has stopped this device because it has reported problems)
- ⭐ The best CCleaner alternatives in 2020
- ▷ Solution: error de PS4 CE-34788-0






