Skip to main content

Overview

MurfTTSService provides real-time text-to-speech synthesis using Murf AI’s WebSocket streaming API. It supports voice customization options including style, rate, pitch, variation, and custom pronunciation dictionaries.

Source Repository

Source code, examples, and issues for the Murf AI integration

PyPI Package

The pipecat-murf-tts package on PyPI

Murf API

Learn more about the Murf AI API and available voices

API Keys

Sign up and obtain your Murf API key from the dashboard

Installation

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

Prerequisites

Murf Account Setup

Before using the Murf TTS service, you need:
  1. Murf Account: Sign up at Murf AI
  2. API Key: Obtain your API key from the dashboard

Required Environment Variables

  • MURF_API_KEY: Your Murf API key for authentication

Configuration

api_key
str
required
Murf API key for authentication.
url
str
default:"wss://global.api.murf.ai/v1/speech/stream-input"
WebSocket URL for the Murf TTS API.
params
MurfTTSService.InputParams
default:"None"
Voice customization parameters. See Input Parameters below.
text_aggregation_mode
TextAggregationMode
default:"None"
How to aggregate incoming text before synthesis.

Input Parameters

Voice settings passed via the params constructor argument using MurfTTSService.InputParams(...).
ParameterTypeDefaultRange/OptionsDescription
voice_idstr"Matthew"Any valid Murf voice IDVoice identifier for TTS synthesis.
stylestr"Conversational"Voice-specific stylesVoice style (e.g., "Conversational", "Narration").
rateint0-50 to 50Speech rate adjustment.
pitchint0-50 to 50Pitch adjustment.
pronunciation_dictionarydictNoneCustom pronunciation mappingsDictionary for custom word pronunciations.
variationint10 to 5Variation in pause, pitch, and speed (Gen2 only).
multi_native_localestrNoneLanguage codes (e.g., "en-US")Language for Gen2 model audio.
modelstr"FALCON""FALCON", "GEN2"The model to use for audio output.
sample_rateint441008000, 16000, 24000, 44100, 48000Audio sample rate in Hz.
channel_typestr"MONO""MONO", "STEREO"Audio channel configuration.
formatstr"PCM""MP3", "WAV", "FLAC", "ALAW", "ULAW", "PCM", "OGG"Audio output format.
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_murf_tts import MurfTTSService

tts = MurfTTSService(
    api_key=os.getenv("MURF_API_KEY"),
    params=MurfTTSService.InputParams(
        voice_id="Matthew",
        style="Conversational",
        rate=0,
        pitch=0,
        sample_rate=44100,
        format="PCM",
    ),
)

# ... add tts to your pipeline:
pipeline = Pipeline([
    context_aggregator.user(),
    llm,
    tts,
    context_aggregator.assistant(),
])

Compatibility

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