Skip to main content

Overview

DeepdubTTSService generates speech from text using Deepdub AI’s real-time streaming WebSocket API. It extends Pipecat’s InterruptibleTTSService and pushes TTSAudioRawFrame audio into the pipeline, with support for multiple models (dd-etts-2.5, dd-etts-3.0), voice customization, and accent control.

Source Repository

Source code, examples, and issues for the Deepdub TTS integration

PyPI Package

The pipecat-deepdub-tts package on PyPI

Deepdub AI

Learn more about Deepdub AI and sign up for an API key

Installation

This is a community-maintained package distributed separately from pipecat-ai:
uv add pipecat-deepdub-tts

Prerequisites

Deepdub Account Setup

Before using the Deepdub TTS service, you need:
  1. Deepdub Account: Sign up at Deepdub AI
  2. API Key: Obtain your API key from your Deepdub account
  3. Voice Prompt ID: A voice prompt ID to use for synthesis

Required Environment Variables

  • DEEPDUB_API_KEY: Your Deepdub API key for authentication
  • DEEPDUB_VOICE_ID: The voice prompt ID used for synthesis

Configuration

api_key
str
required
Deepdub API key for authentication.
voice_id
str
required
Voice prompt ID to use for synthesis.
model
str
default:"dd-etts-2.5"
TTS model name (e.g. "dd-etts-2.5", "dd-etts-3.0").
sample_rate
int
default:"16000"
Audio sample rate in Hz. Valid values: 8000, 16000, 22050, 24000, 44100, 48000.
params
DeepdubTTSService.InputParams
default:"None"
Optional voice customization parameters. See InputParams below.

InputParams

Optional voice customization passed via the params constructor argument using DeepdubTTSService.InputParams(...).
ParameterTypeDefaultDescription
localestr"en-US"Language locale for synthesis.
temperaturefloatNoneControls output variability.
variancefloatNoneControls variance in generated speech.
tempofloatNoneSpeech tempo multiplier.
prompt_boostboolNoneEnable prompt boosting for improved quality.
accent_base_localestrNoneBase locale for accent control. All three accent params required together.
accent_localestrNoneTarget accent locale.
accent_ratiofloatNoneAccent blending ratio (0.0 to 1.0).
Available parameters and defaults are defined by the integration. See the source repository for the authoritative, up-to-date list.

Usage

import os
from pipecat_deepdub_tts import DeepdubTTSService

tts = DeepdubTTSService(
    api_key=os.getenv("DEEPDUB_API_KEY"),
    voice_id=os.getenv("DEEPDUB_VOICE_ID"),
    model="dd-etts-2.5",
    sample_rate=24000,
    params=DeepdubTTSService.InputParams(
        locale="en-US",
        temperature=0.7,
        tempo=1.1,
        prompt_boost=True,
    ),
)

# ... add tts to your pipeline, e.g. Pipeline([llm, tts, ...])

Compatibility

Tested with Pipecat v0.0.97. Check the source repository for the latest tested version and changelog.