Skip to main content

Overview

FishAudioTTSService provides real-time text-to-speech synthesis through Fish Audio’s WebSocket-based streaming API. The service offers custom voice models, prosody controls, and multiple audio formats optimized for conversational AI applications with low latency.

Fish TTS API Reference

Pipecat’s API methods for Fish Audio TTS integration

Example Implementation

Complete example with custom voice model

Fish Audio Documentation

Official Fish Audio documentation

Voice Models

Create and manage custom voice models

Installation

To use Fish Audio services, install the required dependencies:

Prerequisites

Fish Audio Account Setup

Before using Fish Audio TTS services, you need:
  1. Fish Audio Account: Sign up at Fish Audio Console
  2. API Key: Generate an API key from your account dashboard
  3. Voice Models: Create or select custom voice models for synthesis

Required Environment Variables

  • FISH_API_KEY: Your Fish Audio API key for authentication

Configuration

FishAudioTTSService

str
required
Fish Audio API key for authentication.
str
default:"None"
deprecated
Reference ID of the voice model to use for synthesis. Deprecated in v0.0.105. Use settings=FishAudioTTSService.Settings(voice=...) instead.
str
default:"None"
deprecated
Deprecated since 0.0.105, removed in 2.0.0. Use settings=FishAudioTTSService.Settings(...) instead.
str
default:"pcm"
Audio output format. Options: "pcm", "opus", "mp3", "wav". Audio is pushed unchanged in TTSAudioRawFrames, which transports play as raw PCM, so use "pcm" unless you decode the audio yourself.
int
default:"None"
Output audio sample rate in Hz. When None, uses the pipeline’s configured sample rate.
InputParams
default:"None"
deprecated
Deprecated since 0.0.105, removed in 2.0.0. Use settings=FishAudioTTSService.Settings(...) instead.
FishAudioTTSService.Settings
default:"None"
Runtime-configurable settings. See Settings below.

Settings

Runtime-configurable settings passed via the settings constructor argument using FishAudioTTSService.Settings(...). These can be updated mid-conversation with TTSUpdateSettingsFrame. See Service Settings for details.

Usage

Basic Setup

With Prosody Controls

Notes

  • voice required: You must specify either voice (preferred) or the deprecated reference_id parameter.
  • Settings updates reconnect: Changing any setting via TTSUpdateSettingsFrame disconnects and reconnects the WebSocket with the new configuration.

Event Handlers

Fish Audio TTS supports the standard service connection events: