> ## Documentation Index
> Fetch the complete documentation index at: https://daily-docs-source-analytics-user-turn-strategies.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Murf AI

> Text-to-speech service implementation using Murf AI's streaming WebSocket API

export const CommunityMaintained = ({maintainer, maintainerUrl, repo}) => <Note>
    <strong>Community-maintained integration.</strong> This service is built and
    maintained by{" "}
    <a href={maintainerUrl} target="_blank" rel="noreferrer">
      {maintainer}
    </a>
    . Pipecat does not test or officially support it. Please report issues and
    request changes on the{" "}
    <a href={repo} target="_blank" rel="noreferrer">
      source repository
    </a>
    . Learn more about{" "}
    <a href="/api-reference/server/services/community-integrations">
      community integrations
    </a>
    .
  </Note>;

<CommunityMaintained maintainer="murf-ai" maintainerUrl="https://github.com/murf-ai" repo="https://github.com/murf-ai/pipecat-murf-tts" />

## Overview

`MurfTTSService` provides real-time text-to-speech synthesis using
[Murf AI](https://murf.ai/)'s WebSocket streaming API. It supports voice
customization options including style, rate, pitch, variation, and custom
pronunciation dictionaries.

<CardGroup cols={2}>
  <Card title="Source Repository" icon="github" href="https://github.com/murf-ai/pipecat-murf-tts">
    Source code, examples, and issues for the Murf AI integration
  </Card>

  <Card title="PyPI Package" icon="cube" href="https://pypi.org/project/pipecat-murf-tts/">
    The `pipecat-murf-tts` package on PyPI
  </Card>

  <Card title="Murf API" icon="book" href="https://murf.ai/api">
    Learn more about the Murf AI API and available voices
  </Card>

  <Card title="API Keys" icon="key" href="https://murf.ai/api/dashboard">
    Sign up and obtain your Murf API key from the dashboard
  </Card>
</CardGroup>

## Installation

This is a community-maintained package distributed separately from `pipecat-ai`:

```bash theme={null}
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](https://murf.ai/api/dashboard)
2. **API Key**: Obtain your API key from the dashboard

### Required Environment Variables

* `MURF_API_KEY`: Your Murf API key for authentication

## Configuration

<ParamField path="api_key" type="str" required>
  Murf API key for authentication.
</ParamField>

<ParamField path="url" type="str" default="wss://global.api.murf.ai/v1/speech/stream-input">
  WebSocket URL for the Murf TTS API.
</ParamField>

<ParamField path="params" type="MurfTTSService.InputParams" default="None">
  Voice customization parameters. See [Input Parameters](#input-parameters)
  below.
</ParamField>

<ParamField path="text_aggregation_mode" type="TextAggregationMode" default="None">
  How to aggregate incoming text before synthesis.
</ParamField>

### Input Parameters

Voice settings passed via the `params` constructor argument using
`MurfTTSService.InputParams(...)`.

| Parameter                  | Type   | Default            | Range/Options                                                    | Description                                            |
| -------------------------- | ------ | ------------------ | ---------------------------------------------------------------- | ------------------------------------------------------ |
| `voice_id`                 | `str`  | `"Matthew"`        | Any valid Murf voice ID                                          | Voice identifier for TTS synthesis.                    |
| `style`                    | `str`  | `"Conversational"` | Voice-specific styles                                            | Voice style (e.g., `"Conversational"`, `"Narration"`). |
| `rate`                     | `int`  | `0`                | `-50` to `50`                                                    | Speech rate adjustment.                                |
| `pitch`                    | `int`  | `0`                | `-50` to `50`                                                    | Pitch adjustment.                                      |
| `pronunciation_dictionary` | `dict` | `None`             | Custom pronunciation mappings                                    | Dictionary for custom word pronunciations.             |
| `variation`                | `int`  | `1`                | `0` to `5`                                                       | Variation in pause, pitch, and speed (Gen2 only).      |
| `multi_native_locale`      | `str`  | `None`             | Language codes (e.g., `"en-US"`)                                 | Language for Gen2 model audio.                         |
| `model`                    | `str`  | `"FALCON"`         | `"FALCON"`, `"GEN2"`                                             | The model to use for audio output.                     |
| `sample_rate`              | `int`  | `44100`            | `8000`, `16000`, `24000`, `44100`, `48000`                       | Audio sample rate in Hz.                               |
| `channel_type`             | `str`  | `"MONO"`           | `"MONO"`, `"STEREO"`                                             | Audio channel configuration.                           |
| `format`                   | `str`  | `"PCM"`            | `"MP3"`, `"WAV"`, `"FLAC"`, `"ALAW"`, `"ULAW"`, `"PCM"`, `"OGG"` | Audio output format.                                   |

<Note>
  Available parameters and defaults are defined by the integration. See the
  [source repository](https://github.com/murf-ai/pipecat-murf-tts) for the
  authoritative, up-to-date list.
</Note>

## Usage

```python theme={null}
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](https://github.com/murf-ai/pipecat-murf-tts) for the latest tested
version and changelog.
