Skip to main content

Fish Audio TTS

How to use the Fish Audio TTS plugin for LiveKit Agents.

Use in Agent Builder

Create a new agent in your browser using this model

Overview

Fish Audio text-to-speech is available in LiveKit Agents through LiveKit Inference and the Fish Audio plugin. With LiveKit Inference, your agent runs on LiveKit's infrastructure to minimize latency. No separate provider API key is required, and usage and rate limits are managed through LiveKit Cloud. Use the plugin instead if you want to manage your own billing and rate limits. Pricing for LiveKit Inference is available on the pricing page .

This plugin allows you to use Fish Audio  as a TTS provider for your voice agents.

LiveKit Inference

Use LiveKit Inference to access Fish Audio TTS without a separate Fish Audio API key.

Model nameModel IDLanguages
S2 Pro
fishaudio/s2-pro
enzhjadefreskoarrunlitplpt
S2.1 Pro
fishaudio/s2.1-pro
enzhjadefreskoarrunlitplpt
S2.1 Pro Free
fishaudio/s2.1-pro-free
enzhjadefreskoarrunlitplpt

Usage

To use Fish Audio, use the TTS class from the inference module:

from livekit.agents import AgentSession, inference
session = AgentSession(
tts=inference.TTS(
model="fishaudio/s2.1-pro",
voice="b347db033a6549378b48d00acb0d06cd",
language="en",
extra_kwargs={
"speed": 1.5,
"volume": 1.2,
}
),
# ... tts, stt, vad, turn_handling, etc.
)
import { AgentSession, inference } from '@livekit/agents';
session = new AgentSession({
tts: new inference.TTS({
model: "fishaudio/s2.1-pro",
voice: "b347db033a6549378b48d00acb0d06cd",
language: "en",
modelOptions: {
speed: 1.5,
volume: 1.2,
}
}),
// ... tts, stt, vad, turnHandling, etc.
});

Parameters

model
Required
string

The model ID from the models list.

voice
Required
string

See voices for guidance on selecting a voice.

languageLanguageCode

Language code for the input text. If not set, the model default applies.

extra_kwargsdict

Additional parameters to pass to the Fish Audio TTS API. See model parameters for supported fields.

In Node.js this parameter is called modelOptions.

Model parameters

Pass the following parameters inside extra_kwargs (Python) or modelOptions (Node.js):

ParameterTypeDefaultNotes
latency"low" | "normal" | "balanced""balanced"Latency-quality trade-off. normal: best quality, balanced: reduced latency, low: lowest latency.
temperaturefloat0.7

Sampling temperature that controls the randomness of the model's output. Higher values make the output more random, while lower values make it more focused and deterministic. Range of valid values can vary by model.

Valid values are between 0.0 and 1.0.
top_pfloat0.7Nucleus sampling probability mass. Valid range: 0.0 to 1.0.
speedfloat1.0Speaking rate multiplier. Valid range: 0.5 to 2.0. 1.0 = normal speed, 0.5 = half speed, 2.0 = double speed. Useful for adjusting pacing without regenerating audio.
volumefloat0.0Volume adjustment in decibels (dB). 0 = no change, positive values = louder, negative values = quieter.
normalizebooleanTrueNormalizes text for numbers, dates and currency. Only available on English and Chinese.
chunk_lengthint300Maximum number of characters per chunk for long text. Text longer than this will be split into multiple chunks and synthesized separately.

Voices

LiveKit Inference supports all of the default "Fish Audio Voices" available in the Fish Audio API. You can explore the available voices in the Fish Audio voice library  (free account required), and use the voice by copying its ID into your LiveKit agent session.

Custom & community voices

Pre-existing custom Fish Audio voices are not available through LiveKit Inference. To use these, create your own Fish Audio account and use the Fish Audio plugin. To create a new custom voice through LiveKit, see Custom voices.

The following is a small sample of the Fish Audio voices available in LiveKit Inference.

Adrian

Friendly, casual American male

English (United States)
Ethan

A curious explainer.

English (United States)
Hannah

A conversational specialist.

English (United States)
Jordan

A motivational speaker.

English (United States)
Laura

A confident female narrator.

English (United States)
Sarah

An engaged speaker.

English (United States)
Selene

A meditative female voice.

English (United States)

String descriptors

As a shortcut, you can also pass a descriptor with the model ID and voice directly to the tts argument in your AgentSession:

from livekit.agents import AgentSession
session = AgentSession(
tts="fishaudio/s2.1-pro:b347db033a6549378b48d00acb0d06cd",
# ... llm, stt, vad, turn_handling, etc.
)
import { AgentSession } from '@livekit/agents';
session = new AgentSession({
tts: "fishaudio/s2.1-pro:b347db033a6549378b48d00acb0d06cd",
// ... llm, stt, vad, turnHandling, etc.
});

Plugin

LiveKit's plugin support for Fish Audio lets you connect directly to Fish Audio's TTS API with your own API key.

Available inPython

Installation

Install the plugin from PyPI:

uv add "livekit-agents[fishaudio]~=1.6"

Authentication

The Fish Audio plugin requires an API key from Fish Audio .

Set FISH_API_KEY in your .env.local file.

Usage

Use Fish Audio TTS within an AgentSession or as a standalone speech generator. For example, you can use this TTS in the Voice AI quickstart.

from livekit.plugins import fishaudio
session = AgentSession(
tts=fishaudio.TTS(
model="s2.1-pro",
voice_id="933563129e564b19a115bedd57b7406a",
),
# ... llm, stt, etc.
)

Voices

Fish Audio identifies each voice by a reference ID. Browse the Fish Audio playground  to find a voice, or create your own custom voice model, then copy its ID into the voice_id parameter.

Parameters

This section describes some of the available parameters. See the plugin reference for a complete list of all available parameters.

modelstringDefault: s2.1-pro

Fish Audio TTS model to use. Set to s1, s2-pro, or s2.1-pro.

voice_idstring

ID of the voice (reference ID) to use. Defaults to a built-in voice. See Voices to find or create voice IDs.

output_formatstringDefault: wav

Audio output format. Set to wav, pcm, mp3, or opus.

latency_modestringDefault: balanced

Tradeoff between synthesis latency and quality. Set to normal, balanced, or low.

speedfloat

Speaking rate multiplier from 0.5 to 2.0, where 1.0 is normal. Lower values slow speech down and higher values speed it up. When unset, the voice uses its natural pace.

volumefloat

Loudness adjustment in decibels from -20 to 20, where 0 is the voice's natural level. Positive values make speech louder and negative values make it quieter. When unset, the level stays the same.

temperaturefloatDefault: 0.7

Sampling temperature from 0 to 1. Higher values produce more varied, expressive speech and lower values are more stable and consistent.

top_pfloatDefault: 0.7

Nucleus sampling probability mass from 0 to 1. Lower values keep the output to the most likely results and higher values allow more variety.

normalizebooleanDefault: True

Whether to normalize written-form text such as numbers, dates, and abbreviations into spoken form before synthesis.

Additional resources

The following resources provide more information about using Fish Audio with LiveKit Agents.