This is a Wyoming protocol server for Google Cloud Speech-to-Text.
It functions as a Speech-to-Text (STT) component designed to be used by Home Assistant. It allows Assist to recognize voice commands, transforming audio into text so it can subsequently be processed as intents to execute actions. It supports streaming transcription, allowing for low-latency response times, and includes support for phrase boosting (speech contexts) to improve accuracy for specific commands.
- Audio Stream: The client (e.g., Home Assistant Assist) sends audio chunks to this server via the Wyoming protocol.
- Cloud Processing: This server authenticates with Google Cloud using your Service Account credentials and streams the audio asynchronously to the Google Speech-to-Text API.
- Transcription: Google processes the audio in real-time using its advanced ML models.
- Result: The transcribed text is returned to this server, which delivers it to the Wyoming client as a finalized transcript to be processed as an intent.
- Google Cloud Platform (GCP) Account
- Service Account JSON Key (created below)
- Docker
- Docker Compose
To enable cloud speech recognition, you must configure a Google Cloud project and generate a Service Account JSON key. Note: Google requires a billing account to be enabled on your project, even if your usage falls within the free usage tier.
-
Set up GCP Project & Billing:
- Open the Google Cloud Console.
- Create a new project or select an existing one.
- Crucially, enable billing for the chosen project.
-
Enable the Speech-to-Text API:
- In the GCP Console, navigate to the APIs & Services dashboard.
- Search for "Cloud Speech-to-Text API" and click the ENABLE button.
-
Create a Service Account:
- Go to the IAM & Admin > Service Accounts section.
- Click CREATE SERVICE ACCOUNT.
- Provide a clear Service Account Name (e.g.,
wyoming-stt-access) and description, then click DONE.
-
Generate and Download the Key File:
- From the same IAM & Admin > Service Accounts page, click the name of the Service Account you just created.
- Navigate to the KEYS tab and select ADD KEY > Create new key.
- Choose JSON as the key type and click CREATE.
-
Finalize: Rename the downloaded file to
credentials.jsonand place it in the root directory where yourdocker-compose.yamlfile is located. This file is required by theVolumesconfiguration.
- Clone the repository:
git clone https://github.com/Cheerpipe/wyoming_google_stt.git cd wyoming_google_stt - Build the container image:
bash scripts/build.sh
- Configure: Edit the
docker-compose.yamlfile to set your required environment variables (DEBUG_LOGGINGANDCREDENTIALS_FILE) and volume paths (see sections below). - Run the container:
(Use
docker compose up -d
-dfor detached execution.)
The server requires a volume mount for the Google Cloud credentials file.
| Path (Inside Container) | Description | Recommended Host Mount Example |
|---|---|---|
| /data/credentials.json | REQUIRED. The JSON file containing your Google Cloud Service Account keys. | ./credentials.json |
You can configure the service using environment variables in your docker-compose.yaml.
| Variable | Description | Default / Example |
|---|---|---|
| CREDENTIALS_FILE | REQUIRED. Path to the credentials JSON file inside the container. | /data/credentials.json |
| DEBUG_LOGGING | Set to TRUE to enable debug-level logging output. |
FALSE |
A special thank you to sdetweil for creating and sharing the repository: https://github.com/sdetweil/wyoming-google. Your work provided the foundation and necessary inspiration for building this Wyoming STT component.