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

# ReadAloud TTS

> ReadAloudHttpTTSService provides low-latency HTTP streaming speech synthesis with 8 kHz telephony output in Pipecat pipelines.

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="tsushanth" maintainerUrl="https://github.com/tsushanth" repo="https://github.com/tsushanth/pipecat-readaloud" />

## Overview

[ReadAloud](https://readaloudai.org) is a streaming text-to-speech API built for
voice agents and phone calls. `ReadAloudHttpTTSService` streams audio from the
ReadAloud HTTP endpoint as it is generated, so a pipeline can start speaking
within a few hundred milliseconds. It outputs 24 kHz, 16 kHz or 8 kHz PCM and
mu-law or A-law, which suits Twilio and Telnyx media streams. The integration is
maintained by the author of ReadAloud, the speech API provider.

<CardGroup cols={2}>
  <Card title="Source Repository" icon="github" href="https://github.com/tsushanth/pipecat-readaloud">
    Source code, runnable example and changelog
  </Card>

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

## Installation

```sh theme={null}
uv add pipecat-readaloud
```

Last tested with Pipecat 1.12.0. The package requires `pipecat-ai>=1.12,<2`.

## Prerequisites

* A ReadAloud API key from [readaloudai.org/developers](https://readaloudai.org/developers).
  New keys include a small free allowance.
* Set `READALOUD_API_KEY` in your application environment.

## Configuration

| Parameter | Default | Description |
| - | - | - |
| `api_key` | `READALOUD_API_KEY` env var | ReadAloud API key |
| `base_url` | `https://api.readaloudai.org` | API origin |
| `engine` | `"piper"` | `"piper"` (default, fastest) or `"kokoro"` |
| `output_format` | `"auto"` | `auto`, `pcm_24000`, `pcm_16000`, `pcm_8000`, `mulaw_8000` or `alaw_8000` |
| `sample_rate` | Pipeline rate | Pipeline output rate. Use `8000` for Twilio and Telnyx |
| `aiohttp_session` | Created if omitted | Shared `aiohttp.ClientSession` |
| `max_retries` | `3` | Retries before the first audio byte on capacity, 5xx and connection errors |

Additional keyword arguments pass to Pipecat's `TTSService`. `voice` and `speed`
are runtime settings: change them with
`ReadAloudHttpTTSService.Settings(voice="default", speed=1.1)` inside a
`TTSUpdateSettingsFrame(delta=...)`.

## Usage

```python theme={null}
import os
import aiohttp
from pipecat.pipeline.pipeline import Pipeline
from pipecat_readaloud import ReadAloudHttpTTSService

async def build_pipeline(transport, stt, llm):
    async with aiohttp.ClientSession() as session:
        tts = ReadAloudHttpTTSService(
            api_key=os.environ["READALOUD_API_KEY"],
            aiohttp_session=session,
            sample_rate=8000,  # 8000 for Twilio/Telnyx; 24000 is the native rate
            settings=ReadAloudHttpTTSService.Settings(voice="default", speed=1.0),
        )
        # Supply your application's transport, STT, LLM and context aggregators.
        return Pipeline([transport.input(), stt, llm, tts, transport.output()])
```

On interruption Pipecat cancels the in-flight synthesis and the connection is
closed, which stops generation on the server. Capacity errors (HTTP 503 and 429)
and 502/504 responses are retried with backoff until the first audio byte;
authentication, quota and unknown-voice errors surface immediately as an
`ErrorFrame`. The API returns no word timestamps, so `TTSTextFrame`s are not
time-aligned.

See the [source repository](https://github.com/tsushanth/pipecat-readaloud) for a
single-file runnable example that needs only a ReadAloud API key, plus the
changelog.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.