Skip to main content

Overview

SpeechifyHttpTTSService streams PCM audio and word-level speech marks over Server-Sent Events from Speechify’s /v1/audio/stream/with-timestamps endpoint. Audio and timestamps arrive together, enabling word-by-word conversation context attribution and accurate interruption handling.

Speechify API Reference

Pipecat’s API methods for Speechify TTS integration

Example Implementation

Complete example with Deepgram STT and OpenAI LLM

Update Settings Example

Changing voice mid-conversation with TTSUpdateSettingsFrame

Installation

Prerequisites

Before using SpeechifyHttpTTSService, you need:
  1. Speechify Account: Sign up for API access
  2. API Key: Obtain an API key for authentication
  3. Voice Selection: Choose from available Speechify voice models

Required Environment Variables

  • SPEECHIFY_API_KEY: Your Speechify API key for authentication
  • SPEECHIFY_VOICE_ID (optional): Default voice identifier to use

Configuration

str
required
Speechify API key for authentication.
aiohttp.ClientSession
required
An aiohttp session for HTTP requests. You must create and manage this yourself.
str
default:"https://api.speechify.ai"
Base URL for the Speechify API.
int
default:"None"
Audio sample rate in Hz. When None, uses the pipeline’s configured sample rate. Must be one of: 8000, 16000, 22050, 24000, 44100, 48000. If the requested rate is not supported, the service synthesizes at 24000 Hz and the output transport will resample.
SpeechifyHttpTTSService.Settings
default:"None"
Runtime-configurable settings. See SpeechifyHttpTTSService Settings below.
TextAggregationMode
default:"None"
How to aggregate incoming text before synthesis. Controls whether text is buffered into sentences or sent immediately.

SpeechifyHttpTTSService Settings

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

Usage

Basic Setup

Multilingual Setup

For languages other than English, use the simba-3.0 model:

Changing Voice Mid-Conversation

Notes

  • Speech marks requirement: Word-level timestamps are only produced by the streaming-native models simba-3.2 (English) and simba-3.0 (multilingual). The legacy simba-english and simba-multilingual models cannot produce speech marks and are rejected by the /v1/audio/stream/with-timestamps endpoint.
  • Sample rate validation: If the requested sample rate is not one of the supported values (8000, 16000, 22050, 24000, 44100, 48000 Hz), the service synthesizes at 24000 Hz by default and logs a warning. The output transport will handle any necessary resampling.
  • Supported languages: The service supports German (DE), English (EN), Spanish (ES), French (FR), Italian (IT), and Portuguese (PT). Languages outside this set fall back to their BCP-47 tag value with a warning.
  • HTTP-based service: Unlike WebSocket-based TTS services, SpeechifyHttpTTSService processes each synthesis request over HTTP with Server-Sent Events streaming. The service handles interruptions by tracking word-level timestamps.