-
Create a project with the Google Cloud Console, and enable the Speech API.
-
From the Cloud Console, create a service account, download its json credentials file, then set the
GOOGLE_APPLICATION_CREDENTIALS
environment variable:export GOOGLE_APPLICATION_CREDENTIALS=/path/to/your-project-credentials.json
Before running any example you must first install the Speech API client:
go get -u cloud.google.com/go/speech/apiv1
To run the example with a local file:
go run caption.go ../testdata/audio.raw
To run the example with a GCS file:
go run caption.go gs://...