> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pipecat.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Google

> Text-to-speech service using Google's Cloud Text-to-Speech API

## Overview

Google Cloud Text-to-Speech provides high-quality speech synthesis with two service implementations: `GoogleTTSService` (WebSocket-based) for streaming with the lowest latency, and `GoogleHttpTTSService` (HTTP-based) for simpler integration. `GoogleTTSService` is recommended for real-time applications.

<CardGroup cols={2}>
  <Card title="Google TTS API Reference" icon="code" href="https://reference-server.pipecat.ai/en/latest/api/pipecat.services.google.tts.html">
    Pipecat's API methods for Google Cloud TTS integration
  </Card>

  <Card title="Example Implementation" icon="play" href="https://github.com/pipecat-ai/pipecat/blob/main/examples/voice/voice-google.py">
    Complete example with Chirp 3 HD voice
  </Card>

  <Card title="Google Cloud Documentation" icon="book" href="https://cloud.google.com/text-to-speech/docs">
    Official Google Cloud Text-to-Speech documentation
  </Card>

  <Card title="Voice Gallery" icon="microphone" href="https://cloud.google.com/text-to-speech/docs/voices">
    Browse available voices and languages
  </Card>
</CardGroup>

## Installation

To use Google services, install the required dependencies:

```bash theme={null}
uv add "pipecat-ai[google]"
```

## Prerequisites

### Google Cloud Setup

Before using Google Cloud TTS services, you need:

1. **Google Cloud Account**: Sign up at [Google Cloud Console](https://console.cloud.google.com/)
2. **Project Setup**: Create a project and enable the Text-to-Speech API
3. **Service Account**: Create a service account with TTS permissions
4. **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

### GoogleTTSService

Streaming service optimized for Chirp 3 HD and Journey voices.

<ParamField path="credentials" type="str" default="None">
  JSON string containing Google Cloud service account credentials.
</ParamField>

<ParamField path="credentials_path" type="str" default="None">
  Path to Google Cloud service account JSON file.
</ParamField>

<ParamField path="location" type="str" default="None">
  Google Cloud location for regional endpoint (e.g., `"us-central1"`).
</ParamField>

<ParamField path="voice_id" type="str" default="en-US-Chirp3-HD-Charon" deprecated>
  Google TTS voice identifier. *Deprecated in v0.0.105. Use
  `settings=GoogleTTSService.Settings(voice=...)` instead.*
</ParamField>

<ParamField path="voice_cloning_key" type="str" default="None">
  Voice cloning key for Chirp 3 custom voices.
</ParamField>

<ParamField path="sample_rate" type="int" default="None">
  Output audio sample rate in Hz. When `None`, uses the pipeline's configured
  sample rate.
</ParamField>

<ParamField path="params" type="InputParams" default="InputParams()" deprecated>
  *Deprecated in v0.0.105. Use `settings=GoogleTTSService.Settings(...)`
  instead.*
</ParamField>

<ParamField path="settings" type="GoogleTTSService.Settings" default="None">
  Runtime-configurable settings. See [GoogleTTSService
  Settings](#googlettsservice-settings) below.
</ParamField>

#### GoogleTTSService Settings

Runtime-configurable settings passed via the `settings` constructor argument using `GoogleTTSService.Settings(...)`. These can be updated mid-conversation with `TTSUpdateSettingsFrame`. See [Service Settings](/pipecat/fundamentals/service-settings) for details.

| Parameter       | Type              | Default     | Description                              |
| --------------- | ----------------- | ----------- | ---------------------------------------- |
| `model`         | `str`             | `None`      | Model identifier. *(Inherited.)*         |
| `voice`         | `str`             | `None`      | Voice identifier. *(Inherited.)*         |
| `language`      | `Language \| str` | `None`      | Language for synthesis. *(Inherited.)*   |
| `speaking_rate` | `float`           | `NOT_GIVEN` | Speaking rate in the range \[0.25, 2.0]. |

### GoogleHttpTTSService

HTTP service with full SSML support for all voice types.

<ParamField path="credentials" type="str" default="None">
  JSON string containing Google Cloud service account credentials.
</ParamField>

<ParamField path="credentials_path" type="str" default="None">
  Path to Google Cloud service account JSON file.
</ParamField>

<ParamField path="location" type="str" default="None">
  Google Cloud location for regional endpoint.
</ParamField>

<ParamField path="voice_id" type="str" default="en-US-Chirp3-HD-Charon" deprecated>
  Google TTS voice identifier. *Deprecated in v0.0.105. Use
  `settings=GoogleHttpTTSService.Settings(voice=...)` instead.*
</ParamField>

<ParamField path="sample_rate" type="int" default="None">
  Output audio sample rate in Hz.
</ParamField>

<ParamField path="params" type="InputParams" default="None" deprecated>
  *Deprecated in v0.0.105. Use `settings=GoogleHttpTTSService.Settings(...)`
  instead.*
</ParamField>

<ParamField path="settings" type="GoogleHttpTTSService.Settings" default="None">
  Runtime-configurable settings. See [GoogleHttpTTSService
  Settings](#googlehttpttsservice-settings) below.
</ParamField>

#### GoogleHttpTTSService Settings

Runtime-configurable settings passed via the `settings` constructor argument using `GoogleHttpTTSService.Settings(...)`. These can be updated mid-conversation with `TTSUpdateSettingsFrame`. See [Service Settings](/pipecat/fundamentals/service-settings) for details.

| Parameter       | Type              | Default     | Description                                                                                  |
| --------------- | ----------------- | ----------- | -------------------------------------------------------------------------------------------- |
| `model`         | `str`             | `None`      | Model identifier. *(Inherited.)*                                                             |
| `voice`         | `str`             | `None`      | Voice identifier. *(Inherited.)*                                                             |
| `language`      | `Language \| str` | `None`      | Language for synthesis. *(Inherited.)*                                                       |
| `pitch`         | `str`             | `NOT_GIVEN` | Voice pitch adjustment (e.g., `"+2st"`, `"-50%"`).                                           |
| `rate`          | `str`             | `NOT_GIVEN` | Speaking rate for SSML prosody (non-Chirp voices, e.g., `"slow"`, `"fast"`, `"125%"`).       |
| `speaking_rate` | `float`           | `NOT_GIVEN` | Speaking rate for AudioConfig (Chirp/Journey voices). Range \[0.25, 2.0].                    |
| `volume`        | `str`             | `NOT_GIVEN` | Volume adjustment (e.g., `"loud"`, `"soft"`, `"+6dB"`).                                      |
| `emphasis`      | `Literal`         | `NOT_GIVEN` | Emphasis level: `"strong"`, `"moderate"`, `"reduced"`, `"none"`.                             |
| `gender`        | `Literal`         | `NOT_GIVEN` | Voice gender preference: `"male"`, `"female"`, `"neutral"`.                                  |
| `google_style`  | `Literal`         | `NOT_GIVEN` | Google-specific voice style: `"apologetic"`, `"calm"`, `"empathetic"`, `"firm"`, `"lively"`. |

### GeminiTTSService

Streaming service using Gemini's TTS-specific models with natural voice control, prompts for style instructions, and multi-speaker support.

<ParamField path="model" type="str" default="gemini-2.5-flash-tts" deprecated>
  Gemini TTS model to use. Options: `"gemini-2.5-flash-tts"`,
  `"gemini-2.5-pro-tts"`. *Deprecated in v0.0.105. Use
  `settings=GeminiTTSService.Settings(model=...)` instead.*
</ParamField>

<ParamField path="credentials" type="str" default="None">
  JSON string containing Google Cloud service account credentials.
</ParamField>

<ParamField path="credentials_path" type="str" default="None">
  Path to Google Cloud service account JSON file.
</ParamField>

<ParamField path="location" type="str" default="None">
  Google Cloud location for regional endpoint.
</ParamField>

<ParamField path="voice_id" type="str" default="Kore" deprecated>
  Voice name from available Gemini voices (e.g., `"Kore"`, `"Charon"`, `"Puck"`,
  `"Zephyr"`). *Deprecated in v0.0.105. Use
  `settings=GeminiTTSService.Settings(voice=...)` instead.*
</ParamField>

<ParamField path="sample_rate" type="int" default="None">
  Output audio sample rate in Hz. Google TTS outputs at 24kHz; mismatched rates
  will produce a warning.
</ParamField>

<ParamField path="params" type="InputParams" default="None" deprecated>
  *Deprecated in v0.0.105. Use `settings=GeminiTTSService.Settings(...)`
  instead.*
</ParamField>

<ParamField path="settings" type="GeminiTTSService.Settings" default="None">
  Runtime-configurable settings. See [GeminiTTSService
  Settings](#geminittsservice-settings) below.
</ParamField>

#### GeminiTTSService Settings

Runtime-configurable settings passed via the `settings` constructor argument using `GeminiTTSService.Settings(...)`. These can be updated mid-conversation with `TTSUpdateSettingsFrame`. See [Service Settings](/pipecat/fundamentals/service-settings) for details.

| Parameter         | Type              | Default     | Description                                                                                                       |
| ----------------- | ----------------- | ----------- | ----------------------------------------------------------------------------------------------------------------- |
| `model`           | `str`             | `None`      | Model identifier. *(Inherited.)*                                                                                  |
| `voice`           | `str`             | `None`      | Voice identifier. *(Inherited.)*                                                                                  |
| `language`        | `Language \| str` | `None`      | Language for synthesis. *(Inherited.)*                                                                            |
| `prompt`          | `str`             | `NOT_GIVEN` | Style instructions for how to synthesize the content.                                                             |
| `multi_speaker`   | `bool`            | `NOT_GIVEN` | Enable multi-speaker support.                                                                                     |
| `speaker_configs` | `list[dict]`      | `NOT_GIVEN` | Speaker configurations for multi-speaker mode. Each dict should have `speaker_alias` and optionally `speaker_id`. |

## Usage

### Basic Setup (Streaming)

```python theme={null}
from pipecat.services.google import GoogleTTSService

tts = GoogleTTSService(
    credentials_path="/path/to/service-account.json",
    settings=GoogleTTSService.Settings(
        voice="en-US-Chirp3-HD-Charon",
        language=Language.EN_US,
    )
)
```

### HTTP Service with SSML

```python theme={null}
from pipecat.services.google import GoogleHttpTTSService
from pipecat.transcriptions.language import Language

tts = GoogleHttpTTSService(
    credentials_path="/path/to/service-account.json",
    settings=GoogleHttpTTSService.Settings(
        voice="en-US-Standard-A",
        language=Language.EN_US,
        rate="1.1",
        pitch="+2st",
    ),
)
```

### Gemini TTS with Style Prompt

```python theme={null}
from pipecat.services.google import GeminiTTSService
from pipecat.transcriptions.language import Language

tts = GeminiTTSService(
    credentials_path="/path/to/service-account.json",
    settings=GeminiTTSService.Settings(
        model="gemini-2.5-flash-tts",
        voice="Kore",
        language=Language.EN_US,
        prompt="Say this in a friendly and helpful tone"
    )
)
```

<Tip>
  The `InputParams` / `params=` pattern is deprecated as of v0.0.105. Use
  `Settings` / `settings=` instead. See the [Service Settings
  guide](/pipecat/fundamentals/service-settings) for migration details.
</Tip>

## Notes

* **Streaming vs HTTP**: `GoogleTTSService` uses the streaming API for low latency and only supports Chirp 3 HD and Journey voices. `GoogleHttpTTSService` supports all Google voices including Standard and WaveNet, with full SSML support.
* **Chirp/Journey voices and SSML**: Chirp and Journey voices do not support SSML. The HTTP service automatically uses plain text input for these voices.
* **Speaking rate**: For Chirp and Journey voices, use `speaking_rate` (float, 0.25-2.0) in `settings`. For other voices, use `rate` (string) for SSML prosody control.
* **Gemini TTS sample rate**: Google TTS always outputs at 24kHz. Setting a different sample rate will produce a warning and may cause audio issues.
* **Gemini multi-speaker**: Use `multi_speaker=True` with `speaker_configs` to generate conversations between multiple voices. Markup text with speaker aliases to control which voice speaks.
