Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@
"server/services/tts/openai",
"server/services/tts/piper",
"server/services/tts/playht",
"server/services/tts/respeecher",
"server/services/tts/rime",
"server/services/tts/sarvam",
"server/services/tts/xtts"
Expand Down
1 change: 1 addition & 0 deletions server/services/supported-services.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ Text-to-Speech services receive text input and output audio streams or chunks.
| [OpenAI](/server/services/tts/openai) | `pip install "pipecat-ai[openai]"` |
| [Piper](/server/services/tts/piper) | No dependencies required |
| [PlayHT](/server/services/tts/playht) | `pip install "pipecat-ai[playht]"` |
| [Respeecher](/server/services/tts/respeecher) | `pip install "pipecat-ai[respeecher]"` |
| [Rime](/server/services/tts/rime) | `pip install "pipecat-ai[rime]"` |
| [Sarvam](/server/services/tts/sarvam) | No dependencies required |
| [XTTS](/server/services/tts/xtts) | `pip install "pipecat-ai[xtts]"` |
Expand Down
132 changes: 132 additions & 0 deletions server/services/tts/respeecher.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
---
title: "Respeecher"
description: "Text-to-speech service using the Respeecher Space WebSocket API"
---

## Overview

The Respeecher Space API provides high-quality streaming text-to-speech synthesis with low latency.

<CardGroup cols={3}>
<Card
title="API Reference"
icon="code"
href="https://reference-server.pipecat.ai/en/latest/api/pipecat.services.respeecher.tts.html"
>
Complete API documentation and method details
</Card>
<Card
title="Respeecher Docs"
icon="book"
href="https://space.respeecher.com/docs"
>
Official Respeecher Space documentation
</Card>
<Card
title="Example Code"
icon="play"
href="https://github.com/pipecat-ai/pipecat/blob/main/examples/foundational/07ad-interruptible-respeecher.py"
>
Working example with interruption handling
</Card>
</CardGroup>

## Installation

To use Respeecher services, install the required dependencies:

```bash
pip install "pipecat-ai[respeecher]"
```

You'll also need to set up your Respeecher API key as an environment variable: `RESPEECHER_API_KEY`.

<Tip>
Get your API key by signing up at
[Respeecher Space](https://space.respeecher.com/).
</Tip>

## Frames

### Input

- `TextFrame` - Text to synthesize into speech, subject to optional aggregation
- `TTSSpeakFrame` - Text that should be spoken immediately
- `TTSUpdateSettingsFrame` - Runtime configuration updates (e.g., voice, sampling params)
- `LLMFullResponseStartFrame` / `LLMFullResponseEndFrame` - LLM response boundaries

### Output

- `TTSStartedFrame` - Signals start of synthesis
- `TTSAudioRawFrame` - Generated audio data chunks
- `TTSStoppedFrame` - Signals completion of synthesis
- `ErrorFrame` - Connection or processing errors

## Language Support

Refer to the Respeecher Space [Docs](https://space.respeecher.com/docs)
for language support in different models.

## Supported Sample Rates

All common sample rates are supported.

## Usage Example

Initialize the WebSocket service with your API key and desired voice:

```python
from pipecat.services.respeecher.tts import RespeecherTTSService
import os

# Configure WebSocket service
tts = RespeecherTTSService(
api_key=os.getenv("RESPEECHER_API_KEY"),
voice_id="samantha",
params=RespeecherTTSService.InputParams(
sampling_params={
# Optional sampling params overrides
# See https://space.respeecher.com/docs/api/tts/sampling-params-guide
# "temperature": 0.5
},
),
)

# Use in pipeline
pipeline = Pipeline([
transport.input(),
stt,
llm,
tts,
transport.output()
])
```

### Dynamic Configuration

Make settings updates by pushing a `TTSUpdateSettingsFrame` for the `RespeecherTTSService`:

```python
from pipecat.frames.frames import TTSUpdateSettingsFrame

await task.queue_frame(
TTSUpdateSettingsFrame(settings={"voice": "your-new-voice-id", "sampling_params": {"temperature": 0.5}})
)
```

## Metrics

This service provides:

- **Time to First Byte (TTFB)** - Latency from text input to first audio
- **Processing Duration** - Total synthesis time
- **Usage Metrics** - Character count and synthesis statistics

<Info>
[Learn how to enable Metrics](/guides/fundamentals/metrics) in your Pipeline.
</Info>

## Additional Notes

- **Connection Management**: WebSocket lifecycle is handled automatically with reconnection support
- **Sample Rate**: Set globally in `PipelineParams` rather than per-service for consistency