Skip to Content
Google Cloud Platform Cookbook
book

Google Cloud Platform Cookbook

by Legorie Rajan PS
April 2018
Intermediate to advanced content levelIntermediate to advanced
280 pages
6h 18m
English
Packt Publishing
Content preview from Google Cloud Platform Cookbook

How to do it...

First, we'll record the voice which needs to be transcribed in FLAC format. Then, we'll use a Python program to invoke the Speech API and get the transcribed response:

  1. Navigate to the Chapter05/speech-api  folder.
  2. If you are on a Linux-based operating system, install the SoX package:
$ sudo apt-get install sox

Or for CentOS:

$ sudo yum install sox
  1. Next, using the rec command, we can record the message which needs to be transcribed:
$ rec -c 1 -r 16000 record.flac trim 0 3

The preceding command will record an audio message for 3 seconds with a sample rate of 16000 Hz.

  1. To execute the program in an isolated environment, create a virtualenv and install the dependent packages:
$ virtualenv ENV$ source ENV/bin/activate$ pip ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Google Compute Engine

Google Compute Engine

Marc Cohen, Kathryn Hurley, Paul Newson
Mastering Google App Engine

Mastering Google App Engine

Mohsin Shafique Hijazee
Google Cloud Platform Administration

Google Cloud Platform Administration

Ranjit Singh Thakurratan
Google Cloud Cookbook

Google Cloud Cookbook

Rui Santos Costa, Drew Hodun

Publisher Resources

ISBN: 9781788291996Supplemental Content