Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@
"server/services/tts/groq",
"server/services/tts/lmnt",
"server/services/tts/minimax",
"server/services/tts/murf",
"server/services/tts/neuphonic",
"server/services/tts/riva",
"server/services/tts/openai",
Expand Down
162 changes: 162 additions & 0 deletions server/services/tts/murf.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
---
title: "Murf.ai"
description: "Text-to-speech services using Murf's WebSocket-based streaming API"
---

## Overview

Murf’s API delivers the most scalable and reliable AI voice generation with **99.38% pronunciation accuracy**. It gives developers access to **150+ natural-sounding voices** across **21 languages** and **20+ speaking styles**, ranging from upbeat promotional tones and dramatic narration to empathetic, conversational support. Powered by our MultiNative technology, Murf voices can speak multiple languages, seamlessly switching mid-sentence while preserving native pronunciation patterns.

Ideal for developers, Murf’s API makes it easy to build engaging audio experiences into any application.
<Tip>
<code>MurfTTSService</code> supports real-time streaming and conversation context IDs.
</Tip>

<CardGroup cols={3}>
<Card
title="API Reference"
icon="code"
href="https://reference-server.pipecat.ai/en/latest/api/pipecat.services.murf.tts.html"
>
Complete API documentation and method details
</Card>
<Card
title="Murf Docs"
icon="book"
href="https://murf.ai/api/docs/api-reference/text-to-speech/stream-input"
>
Official Murf API documentation
</Card>
<Card
title="Example Code"
icon="play"
href="https://murf.ai/api/docs/text-to-speech/web-sockets#quickstart"
>
Working example with WebSocket quickstart
</Card>
</CardGroup>

## Installation

To use Murf services, install the required dependencies:

```bash
pip install "pipecat-ai[murf]"
```

You'll also need to set up your Murf API key as an environment variable: `MURF_API_KEY`.

<Tip>
Get your API key by signing up at [Murf.ai](https://murf.ai/api).
</Tip>

## Frames

### Input

- `TextFrame` - Text content to synthesize into speech
- `TTSSpeakFrame` - Text that the TTS service should speak
- `TTSUpdateSettingsFrame` - Runtime configuration updates
- `StartInterruptionFrame` - Signals interruption request
- `CancelFrame` - Signals cancellation request
- `EndFrame` - Signals end of service

### Output

- `TTSStartedFrame` - Signals start of synthesis
- `TTSAudioRawFrame` - Generated audio data chunks
- `TTSStoppedFrame` - Signals completion of synthesis
- `ErrorFrame` - Connection or processing errors

## Features

| Feature | Support | Notes |
| --------------------- | ------- | ----------------------------------------------- |
| **Streaming** | ✅ | Real-time audio chunks via WebSocket |
| **Voice Styles** | ✅ | Multiple styles including "Conversational" |
| **Rate Control** | ✅ | Adjustable speech rate |
| **Pitch Control** | ✅ | Adjustable pitch |
| **Pronunciation** | ✅ | Custom pronunciation dictionary |
| **Variation** | ✅ | Control over pause, pitch, and speed variation |
| **Multi-language** | ✅ | Support for multiple native locales |
| **Interruption** | ✅ | Graceful handling via context management |
| **Metrics** | ✅ | TTFB and usage metrics |

## Usage Example

Initialize the service with your API key and desired voice configuration:

```python
from pipecat.services.murf.tts import MurfTTSService

# Configure WebSocket service
tts = MurfTTSService(
api_key=os.getenv("MURF_API_KEY"),
params=MurfTTSService.InputParams(
voice_id="en-US-daniel",
style="Conversational",
rate=0,
pitch=0,
variation=1,
sample_rate=44100,
channel_type="MONO",
format="PCM"
)
)

# Use in pipeline
pipeline = Pipeline([
transport.input(),
stt,
llm,
tts,
transport.output()
])
```

### Input Parameters

The `InputParams` class supports the following configuration options:

| Parameter | Type | Default | Description |
| -------------------------- | ------- | --------------- | ---------------------------------------------- |
| `voice_id` | str | "en-US-daniel" | Voice ID for synthesis |
| `style` | str | "Conversational"| Speech style |
| `rate` | int | 0 | Speech rate adjustment |
| `pitch` | int | 0 | Speech pitch adjustment |
| `variation` | int | 1 | Variation in pause, pitch, and speed |
| `pronunciation_dictionary` | dict | None | Custom word pronunciation mappings <br />Example: <br /> <code>\{ "live": \{ "type": "IPA", "pronunciation": "laɪv" }, "2024": \{ "type": "SAY_AS", "pronunciation": "twenty twenty-four" } }</code> |
| `multi_native_locale` | str | None | Specifies the language for the generated audio. Valid values: “en-US”, “en-UK”, “es-ES”, etc. |
| `sample_rate` | int | 44100 | Audio sample rate, 8000, 16000, 24000, 32000, 44100, 48000 |
| `channel_type` | str | "MONO" | Audio channel configuration, "MONO" or "STEREO" |
| `format` | str | "PCM" | Audio output format, "PCM" or "MP3" |


**Note**: Detailed documentation available at [Murf.ai](https://murf.ai/api/docs).

### Dynamic Configuration

You can update voice settings during runtime:

```python
from pipecat.frames.frames import TTSUpdateSettingsFrame

await task.queue_frame(TTSUpdateSettingsFrame(
voice_id="different-voice",
style="Professional",
rate=1,
pitch=1
))
```

## Metrics

The service provides:

- **Time to First Byte (TTFB)** - Latency measurement
- **Processing Duration** - Synthesis time tracking
- **Usage Metrics** - Character count and synthesis statistics

<Info>
[Learn how to enable Metrics](/guides/features/metrics) in your Pipeline.
</Info>