Thumbnail

Google Speech Recognition

by Google

Use the online Google Speech Recognition Service (test beta)

Requires ARC v10 (Updated 12/12/2020)

How to add the Google Speech Recognition robot skill

  1. Load the most recent release of ARC (Get ARC).
  2. Press the Project tab from the top menu bar in ARC.
  3. Press Add Robot Skill from the button ribbon bar in ARC.
  4. Choose the Audio category tab.
  5. Press the Google Speech Recognition icon to add the robot skill to your project.

Don't have a robot yet?

Follow the Getting Started Guide to build a robot and use the Google Speech Recognition robot skill.

How to use the Google Speech Recognition robot skill

This skill is a test for the Google Speech Service with ARC. There is some configuration necessary for testing this skill, as the Google Speech Service is paid and not free. There is a 60 day trial, which you can sign up for. This skill requires internet access, so if an I/O controller is also being used a second WiFi connection, wired network or direct UART connection to the PC is needed.

Main Window

User-inserted image

1. Load Credentials Button This opens the location of your Google speech recognition key (.json) file. Browse to find it's location.

2. Start Recording Button This activates Google speech recognition which will then listen for words and respond accordingly.

3. Visual Feedback Waveform This visually displays the peaks and valleys of the detected frequency. It also shows you if your default recording device is working properly.

4. Response Field This is where Google speech recognition will respond with its text-based response.

Configuration

User-inserted image

1. Response Script  A response script can be activated when certain words are detected.

2. Variable Name Here you can change the variable name for the detected words.

How to Use the Google Speech Recognition Skill

If you wish to use this skill with PandoraBot, you can send the detected speech to the PandoraBot control using the ControlCommand(). For example, you will add both a PandoraBot control and this Google Speech skill to your project.

Don't forget to PAUSE the PandoraBot skill so it doesn't attempt to pickup any audio! We will only be using the Google Speech skill for audio, so the PandoraBot skill can be PAUSED. It will receive speech phrases by the ControlCommand() from the Google Speech response script.

Your project would resemble this...

User-inserted image

Now you can edit the Google Speech skill and add this code to the response script which will send the detected speech to the PandoraBot:


ControlCommand("PandoraBot", SetPhrase, $GoogleSpeech)

The configuration would look like the following image. This will send all received data from the Google Speech skill to the PandoraBot skill.

User-inserted image

Configuring Google Services For Credentials These instructions only provide some assistance. Google has their own support if you need assistance Generating a JSON Service Account Key. We have provided some information below.

*Disclaimer: Google's web config is an absolute frustrating experience with outdated documentation and hidden menu options. It's easy to get lost. Venture forward at your own risk:)

  1. To start, visit https://cloud.google.com/speech/ and select Free Trial

    User-inserted image

  2. From there, you will need to create credentials

    User-inserted image

  3. Configure the Google Cloud Speech API when adding credentials

    User-inserted image

  4. Now create a new credential to get a Service Account Key

    User-inserted image

  5. Select the Service Account that you had already created earlier and choose JSON

    User-inserted image

  6. A JSON file will download automatically. This is the file that you will load in this skill for authentication before it will work. So save it somewhere useful that you can find in the future. Your Downloads Folder is probably not the best place...

    User-inserted image

Enable Billing You will need to enable billing, if you get an error that billing is not enabled. Here is assistance link from google: https://support.google.com/cloud/answer/6293499?hl=en

A credit card is necessary for Google's service. However, they won't charge you after the 60 day trial.

User-inserted image

Requirements

An internet connection is required to access Google's speech recognition database.

Resources

Here's an example project: testgooglespeech.EZB


ARC Pro

Upgrade to ARC Pro

Don't limit your robot's potential – subscribe to ARC Pro and transform it into a dynamic, intelligent machine.

#1  

Hi,

I am using "Google Speech Recognition" It works fine. But I couldn't find a way to Start and Stop "Recording" from the code. How this can be done programmatically.

It looks like I need to press "Start Recording " / "Stop Recording "  manually.

Is there any way to manage this from the script for "Google Speech Recognition)

PRO
Synthiam
#2   — Edited

What does the Cheat Sheet say? I think there's a PAUSE command. Take a look, otherwise I can add something.

United Kingdom
#3  

I get an error in EZB when loading my .json credentials which begins 'please check the value of the environmental variable GOOGLE_APPLICATION_CREDENTIALS' could Google have changed the format of their API key files?

PRO
Synthiam
#4  

Sure could have - I’ll take a look

#5  

hi. so when i load my credentials into the project it says this: "This file must be in the root folder of this plugin. Also, if it is already in the same folder, the DLL filename and the assembly name may be different. To correct this error, either ensure the file is in the root folder of the plugin, or rename the DLL to the assembly name as presented here in this error."

can you help?

Unknown Country
#6  

I am also getting this error message "This file must be in the root folder of this plugin. Also, if it is already in the same folder, the DLL filename and the assembly name may be different. To correct this error, either ensure the file is in the root folder of the plugin, or rename the DLL to the assembly name as presented here in this error." when attempting to set up this function.

PRO
Synthiam
#7  

It appears the Google library is looking for unity. I’ll look into why that is and resolve it. Stay tuned

#8  

I did not find the cost for using the service from Google. Tell me how much does it cost?

they also have a well-tuned voice, many languages with good quality. The price is also unknown. Here is a link to listen to: https://cloud.google.com/text-to-speech

#9  

Was the unity error ever resolved? I'm running into this issue now. When i load the json key it throws this error:  System.TypeInitializationException: The type initializer for 'Grpc.Core.Internal.PlatformApis' threw an exception. ---> System.IO.FileLoadException: Could not load file or assembly 'UnityEngine' or one of its dependencies. General Exception (Exception from HRESULT: 0x80131500) ---> System.Exception: Unable to find a DLL: C:\ProgramData\ARC\Plugins\ac914bee-8fc2-4fbd-b2b5-4661940e3b23\UnityEngine.dll.

This file must be in the root folder of this plugin. Also, if it is already in the same folder, the DLL filename and the assembly name may be different. To correct this error, either ensure the file is in the root folder of the plugin, or rename the DLL to the assembly name as presented here in this error.