Overview
GoogleSTTService provides real-time speech recognition using Google Cloud’s Speech-to-Text V2 API with support for 125+ languages, multiple models, voice activity detection, and advanced features like automatic punctuation and word-level confidence scores.
Google STT API Reference
Pipecat’s API methods for Google Cloud STT integration
Example Implementation
Complete example with Google Cloud services
Google Cloud Documentation
Official Google Cloud Speech-to-Text documentation
Google Cloud Console
Create service accounts and manage API access
Installation
To use Google Cloud Speech services, install the required dependency:Prerequisites
Google Cloud Setup
Before using Google Cloud STT services, you need:- Google Cloud Account: Sign up at Google Cloud Console
- Project Setup: Create a project and enable the Speech-to-Text API
- Service Account: Create a service account with Speech-to-Text permissions
- Authentication: Set up credentials via service account key or Application Default Credentials
Required Environment Variables
GOOGLE_APPLICATION_CREDENTIALS: Path to your service account key file (recommended)- Or use Application Default Credentials for cloud deployments
Configuration
GoogleSTTService
str
default:"None"
JSON string containing Google Cloud service account credentials.
str
default:"None"
Path to service account credentials JSON file.
str
default:"global"
Google Cloud location (e.g.,
"global", "us-central1"). Non-global
locations use regional endpoints.int
default:"None"
Audio sample rate in Hz. When
None, uses the pipeline’s configured sample
rate.GoogleSTTService.InputParams
default:"None"
deprecated
Configuration parameters for the STT service. Deprecated in v0.0.105. Use
settings=GoogleSTTService.Settings(...) instead.GoogleSTTService.Settings
default:"None"
Runtime-configurable settings for the STT service. See Settings
below.
float
default:"GOOGLE_TTFS_P99"
P99 latency from speech end to final transcript in seconds. Override for your
deployment.
You must provide either
credentials (JSON string), credentials_path (file
path), or have Application Default Credentials configured. At least one
authentication method is required.Settings
Runtime-configurable settings passed via thesettings constructor argument using GoogleSTTService.Settings(...). These can be updated mid-conversation with STTUpdateSettingsFrame. See Service Settings for details.
Usage
Basic Setup
With Credentials JSON String
With Custom Parameters
Updating Settings at Runtime
Google STT supports dynamic settings updates viaSTTUpdateSettingsFrame:
Notes
- Streaming time limit: Google Cloud STT has a 5-minute streaming limit per connection. The service automatically handles stream reconnection at 4 minutes to provide seamless transcription without interruption.
- Multi-language support: Pass a list of
Languagevalues tolanguagesfor multi-language recognition. The first language is the primary language. - Regional endpoints: Use the
locationparameter to route requests through regional endpoints (e.g.,"us-central1","europe-west1") for data residency requirements. The default"global"endpoint works for most use cases. - Stream abort on inactivity: If no audio is sent for ~10 seconds (e.g., when audio frames are blocked), Google automatically closes the stream. The service recovers by automatically reconnecting.
- Authentication priority: The service checks for credentials in this order:
credentials(JSON string),credentials_path(file), then Application Default Credentials.