Skip to content

Set Up Google Speech-to-Text

This guide explains how to prepare a Google Cloud project so that QVOICE Platform can transcribe your call recordings and voicemails with Google Speech-to-Text, and how to confirm that it works.

You need it when you choose Google Speech-to-Text as the provider in AI Transcription, for example to transcribe Sinhala or Tamil calls. Google bills the transcriptions to your project.

How it works

sequenceDiagram
    participant P as QVOICE Platform
    participant B as Your Cloud Storage bucket
    participant S as Google Speech-to-Text
    P->>B: Upload the recording (service account)
    P->>S: Transcribe gs://bucket/recording (Chirp 2, your region)
    S->>B: Read the recording (Speech-to-Text service agent)
    S-->>P: Transcript
    P->>B: Delete the recording
    P->>P: Save the transcript with the recording
  • The recording stays in your bucket only while it is being transcribed; it is deleted as soon as Google returns the transcript.
  • The transcript is stored in QVOICE Platform with the recording. Nothing is kept in Google Cloud.

What you need

Item Details
A Google Cloud project With billing enabled. Note its project ID.
Speech-to-Text API speech.googleapis.com, enabled in that project.
Cloud Storage API storage.googleapis.com, enabled in that project (it is enabled by default in new projects).
A Cloud Storage bucket In the same project.
A service account With the Cloud Speech Client role on the project and the Storage Object Admin role on the bucket, and a JSON key.

Warning

Keep the bucket in the same project as the service account. Speech-to-Text reads the audio with its own Google-managed service agent, which can read buckets of its own project by default. A bucket in another project needs extra permissions for that agent and is not covered here.

Step 1 — Enable the APIs

In the Google Cloud console, select the project, open APIs & Services → Library and enable Cloud Speech-to-Text API and Cloud Storage API.

Or with the gcloud CLI:

gcloud config set project PROJECT_ID
gcloud services enable speech.googleapis.com storage.googleapis.com

Step 2 — Create the bucket

Create the bucket in the region you will pick as Region in QVOICE Platform, so the audio is stored and processed in the same place:

QVOICE Platform Region Bucket location
Europe (europe-west4) europe-west4
United States (us-central1) us-central1
Asia (asia-southeast1) asia-southeast1
gcloud storage buckets create gs://BUCKET_NAME \
  --location=europe-west4 \
  --uniform-bucket-level-access \
  --public-access-prevention

Recommended: add a lifecycle rule that deletes objects older than one day. QVOICE Platform already deletes each recording after it is transcribed; the rule cleans up anything left behind if a transcription is interrupted.

cat > lifecycle.json <<'EOF'
{"rule": [{"action": {"type": "Delete"}, "condition": {"age": 1}}]}
EOF
gcloud storage buckets update gs://BUCKET_NAME --lifecycle-file=lifecycle.json

Step 3 — Create the service account and its key

  1. IAM & Admin → Service Accounts → Create service account. Name it, for example, transcription.
  2. Grant it the Cloud Speech Client role (roles/speech.client) on the project.
  3. Open the bucket → Permissions → Grant access, add the service account's email and give it Storage Object Admin (roles/storage.objectAdmin). It needs to create and delete objects in this bucket only.
  4. Open the service account → Keys → Add key → Create new key → JSON. A .json file is downloaded.

Or with gcloud:

gcloud iam service-accounts create transcription --display-name="Call transcription"

SA=transcription@PROJECT_ID.iam.gserviceaccount.com

gcloud projects add-iam-policy-binding PROJECT_ID \
  --member="serviceAccount:$SA" --role="roles/speech.client"

gcloud storage buckets add-iam-policy-binding gs://BUCKET_NAME \
  --member="serviceAccount:$SA" --role="roles/storage.objectAdmin"

gcloud iam service-accounts keys create transcription-key.json --iam-account="$SA"

Warning

The JSON key gives access to your project. Do not send it by email or chat; paste it directly into QVOICE Platform, then delete the downloaded file. If your organisation blocks service account keys (the iam.disableServiceAccountKeyCreation policy), your Google Cloud administrator has to allow it for this project.

Step 4 — Configure QVOICE Platform

In Config → Integrations → AI Transcription → Transcription:

  1. Provider: select Google Speech-to-Text.
  2. Service Account Key (JSON): paste the whole content of the JSON key file.
  3. Cloud Storage Bucket: the bucket name, without gs:// (for example my-transcription-bucket).
  4. Language: the language spoken in your calls.
  5. Region: the same region as the bucket.
  6. One speaker per channel: enable it only if your recordings are stereo with each party on its own channel.
  7. Auto Transcribe Recordings: enable it to transcribe every new recording automatically.
  8. Click Save.

After saving, the key field no longer shows the key: it shows the service account's email. That confirms the key was stored. Saving only checks the format of the key and that a bucket is set; it does not contact Google, so permissions are confirmed in Step 5. To keep the stored key when you change other settings later, leave the field empty.

See AI Transcription for the meaning of each field.

Step 5 — Confirm it works

  1. Make a test call of at least 30 seconds with call recording on, speaking in the configured language.
  2. In the portal, open Reports → Call Recordings, play that recording and request its transcript (or wait for it, if Auto Transcribe Recordings is on). The transcript, split by speaker, appears with the recording.
  3. In the Google Cloud console:
    • APIs & Services → Cloud Speech-to-Text API → Metrics shows the requests.
    • The bucket is empty again once the transcript is back.

Troubleshooting

Symptom Likely cause Fix
Save fails with "A Cloud Storage bucket is required for Google STT" The bucket field is empty. Enter the bucket name.
Save rejects the key The text is not a complete service account JSON key (it needs project_id, client_email and private_key). Paste the whole file content, including the braces.
No transcript appears The service account lacks Cloud Speech Client on the project or Storage Object Admin on the bucket. Grant the roles from Step 3. Role changes can take a few minutes to apply. If it still fails, contact info@fonouc.com with the time of the test call.
No transcript appears, and the Speech-to-Text API metrics show no requests Speech-to-Text API not enabled in the project of the key, or the key belongs to a different project. Step 1. The API must be enabled in the project the key belongs to.
Recordings stay in the bucket The service account cannot delete objects. Use Storage Object Admin, not Storage Object Creator.
The transcript is in the wrong language or mostly empty Language does not match what is spoken. Change Language and transcribe the recording again.

Costs

Each transcribed recording is a Speech-to-Text request billed to your project at Google's Chirp 2 rate, plus a small Cloud Storage cost while the file is in the bucket. See Speech-to-Text pricing.