Build real-time voice AI agents with Fish Audio and LiveKit
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.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.
Set your Fish Audio API key as an environment variable:
export FISH_API_KEY=your_api_key_here
Basic usage
Add Fish Audio TTS to your LiveKit agent:
from livekit.plugins.fishaudio import TTStts = TTS( reference_id="your_voice_model_id", # Optional: use a specific voice model="s2.1-pro", sample_rate=24000, latency_mode="balanced")
Key parameters
Parameter
Description
api_key
Your Fish Audio API key (or use FISH_API_KEY env var)