Skip to content

Commit 0d1bcd0

Browse files
committed
livekit integration plus change pipecat to s1
1 parent 564554c commit 0d1bcd0

4 files changed

Lines changed: 81 additions & 3 deletions

File tree

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
title: "LiveKit"
3+
description: "Build real-time voice AI agents with Fish Audio and LiveKit"
4+
icon: "/images/livekit-logo.jpeg"
5+
---
6+
7+
[LiveKit Agents](https://github.com/livekit/agents) is an open source framework for building real-time voice and multimodal AI agents. It handles streaming audio pipelines, turn detection, interruptions, and LLM orchestration so you can focus on your agent's behavior.
8+
9+
Fish Audio integrates with LiveKit through the `fishaudio` plugin, providing text-to-speech synthesis with support for both chunked and real-time WebSocket streaming modes.
10+
11+
## Prerequisites
12+
13+
- A [Fish Audio account](https://fish.audio) with an API key
14+
- Python 3.9 or higher
15+
16+
## Installation
17+
18+
Install LiveKit Agents with Fish Audio support:
19+
20+
```bash
21+
pip install "livekit-agents[fishaudio]"
22+
```
23+
24+
## Configuration
25+
26+
Set your Fish Audio API key as an environment variable:
27+
28+
```bash
29+
export FISH_API_KEY=your_api_key_here
30+
```
31+
32+
## Basic usage
33+
34+
Add Fish Audio TTS to your LiveKit agent:
35+
36+
```python
37+
from livekit.plugins.fishaudio import TTS
38+
39+
tts = TTS(
40+
reference_id="your_voice_model_id", # Optional: use a specific voice
41+
model="s1",
42+
sample_rate=24000,
43+
latency_mode="balanced"
44+
)
45+
```
46+
47+
### Key parameters
48+
49+
| Parameter | Description |
50+
|-----------|-------------|
51+
| `api_key` | Your Fish Audio API key (or use `FISH_API_KEY` env var) |
52+
| `model` | TTS model/backend to use (default: `s1`) |
53+
| `reference_id` | Voice model ID from the [Fish Audio library](https://fish.audio/discover) |
54+
| `output_format` | Audio format: `pcm`, `mp3`, `wav`, or `opus` (default: `pcm`) |
55+
| `sample_rate` | Audio sample rate in Hz (default: `24000`) |
56+
| `num_channels` | Number of audio channels (default: `1`) |
57+
| `base_url` | Custom API endpoint (default: `https://api.fish.audio`) |
58+
| `latency_mode` | `normal` (~500ms) or `balanced` (~300ms, default) |
59+
60+
### Streaming modes
61+
62+
The plugin supports two synthesis modes:
63+
64+
```python
65+
# Chunked (non-streaming) synthesis
66+
stream = tts.synthesize("Hello, world!")
67+
68+
# Real-time WebSocket streaming
69+
stream = tts.stream()
70+
```
71+
72+
## Resources
73+
74+
- [LiveKit Agents Documentation](https://docs.livekit.io/agents/)
75+
- [LiveKit GitHub](https://github.com/livekit/agents)
76+
- [Fish Audio Plugin Reference](https://docs.livekit.io/reference/python/v1/livekit/plugins/fishaudio/index.html)
77+
- [Fish Audio Voice Library](https://fish.audio/discover)

developer-guide/integrations/pipecat.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ from pipecat.services.fish import FishAudioTTSService
3939
tts = FishAudioTTSService(
4040
api_key=os.getenv("FISH_API_KEY"),
4141
reference_id="your_voice_model_id", # Optional: use a specific voice
42-
model_id="speech-1.5",
42+
model_id="s1",
4343
params=FishAudioTTSService.InputParams(
4444
latency="normal",
4545
prosody_speed=1.0
@@ -53,7 +53,7 @@ tts = FishAudioTTSService(
5353
|-----------|-------------|
5454
| `api_key` | Your Fish Audio API key |
5555
| `reference_id` | Voice model ID from the [Fish Audio library](https://fish.audio/discover) |
56-
| `model_id` | TTS model version (default: `speech-1.5`) |
56+
| `model_id` | TTS model version (default: `s1`) |
5757
| `output_format` | Audio format: `pcm`, `mp3`, `wav`, or `opus` |
5858

5959
### Prosody controls

docs.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@
100100
{
101101
"group": "Integrations",
102102
"pages": [
103-
"developer-guide/integrations/pipecat"
103+
"developer-guide/integrations/pipecat",
104+
"developer-guide/integrations/livekit"
104105
]
105106
},
106107
{

images/livekit-logo.jpeg

2.82 KB
Loading

0 commit comments

Comments
 (0)