Configuring Google Speech

Configuring Google Speech

All users need a Google Speech Service Account which can be obtained free on-line. If you don’t have one yet get one from https://cloud.google.com/speech. Google Speech Service is free up to a certain monthly limit (currently 60 minutes per day).

Click the link to go to the Google Cloud Platform page. Click the “TRY IT FREE” button to continue.

If you don’t already have a Cloud Platform account, create one now. You will be asked to enter a valid billing credit or debit card number to prove you are not a robot and enable billing for any non-free services you may use.

As a thank you to new customers, Google will give you a 60 day trial and $300 credit to use towards their paid services. Google Speech to Text usage is currently free up to 60 minutes per month and then billed every 15 seconds of usage thereafter.

Click the “Create Project” button and create a new project. Give it a descriptive name, you will need this later. For the purposes of this demonstration, I chose to name my project “Adrian”.

You should see a spinning notification icon in the top right corner as your new project is created. It may take a minute or two for Google’s servers to process this. Once your project is created, you should see it listed in the project widget on your Cloud Platform dashboard.

Now we need to enable the Cloud Speech APIs and create a credential file for use with Adrian. Click your mouse into the search bar at the top of the screen and search for “speech” without the quotes. From this popout menu, select “Google Cloud Speech API” to continue.

Click the “Enable” button at the top of the Cloud Speech API page to enable the Cloud Speech APIs for your newly created project. The “Enable” button should now change to read “Disable”. You have now enabled the Cloud Speech APIs for your new project.

To create the credentials file, click the “Credentials” button on the left of the page and then click “Create Credentials” > “Service Account Key”.

In the “Service Account” menu, choose Compute Engine default service account. The key type should be JSON. Finally click the “Create” button.

This will download your Service Account Private key to your computer. We will need to copy this key to the SD card.

Once you have your Service Account key file copy it to the /home/pi/AdrianAppPath/Library/googleSpeech/Account/ folder of your Pi’s SD card. Then Change the /home/pi/AdrianAppPath/constants.js file replacing the values starting with ‘YOUR_’ below:


define("GOOGLE_APPLICATION_CREDENTIALS", __dirname  + "/Library/googleSpeech/Account/YOUR_PROJECT_FILE_NAME_COMES_HERE")
define("GCLOUD_PROJECT", "YOUR_PROJECTN_NAME_COMES_HERE")