Skip to main content

livekit-plugins-readaloud

ReadAloud text-to-speech plugin for LiveKit Agents. It streams audio from the ReadAloud API as it is generated, so a voice agent can start speaking within a few hundred milliseconds, and it can output 8 kHz audio for phone calls. Closing a stream (barge-in) closes the HTTP connection, which stops generation on the server.

Maintainer: this plugin is written and maintained by the author of ReadAloud, the speech API provider.

Installation

pip install livekit-plugins-readaloud
export READALOUD_API_KEY=rtts_...

Get an API key at readaloudai.org/developers. New keys include a small free allowance.

Usage

from livekit.agents import AgentSession
from livekit.plugins import readaloud

session = AgentSession(
    # stt=..., llm=...,
    tts=readaloud.TTS(voice="default", sample_rate=24000),   # sample_rate: 24000 | 16000 | 8000
)

readaloud.TTS(api_key=None, base_url="https://api.readaloudai.org", voice="default", speed=1.0, engine="piper", sample_rate=24000, max_retries=2). api_key falls back to the READALOUD_API_KEY environment variable. engine is "piper" (default) or "kokoro". synthesize() returns a ChunkedStream; stream() returns a SynthesizeStream that splits LLM tokens into sentences and synthesizes each with its own streaming request.

Running the example

examples/readaloud_tts_to_wav.py synthesizes a sentence and saves it as a WAV file. It needs only a ReadAloud API key, with no STT, LLM or LiveKit server:

pip install livekit-plugins-readaloud
export READALOUD_API_KEY=rtts_...
python examples/readaloud_tts_to_wav.py "Thanks for calling. How can I help you today?"

Behaviour

  • Capacity responses (HTTP 503 and 429) become a retryable APIStatusError, so LiveKit's APIConnectOptions retry applies on top of the plugin's own pre-audio retries. Set max_retries=0 to leave retrying to LiveKit.
  • Authentication (401), quota (402), bad request and unknown voice (400, 404) errors surface immediately.
  • No aligned transcripts: the API returns no word timestamps.

Compatibility

Tested with livekit-agents==1.8.5 and Python 3.14; requires livekit-agents>=1.8,<2. The tests run against a local fake of the ReadAloud HTTP protocol (pip install -e '.[dev]' && pytest), and the example and plugin were also run against the live API.

Changelog

See CHANGELOG.md. Licensed under MIT.

Metadata

Release files for livekit-plugins-readaloud 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for livekit-plugins-readaloud 0.1.1
File Size Uploaded
livekit_plugins_readaloud-0.1.1.tar.gz 12.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for livekit-plugins-readaloud 0.1.1
File Interpreter ABI Platform
livekit_plugins_readaloud-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 24.0 kB

Release files / livekit_plugins_readaloud-0.1.1.tar.gz

Download URL livekit_plugins_readaloud-0.1.1.tar.gz
Size 12.7 kB
Tags Source
SHA-256 checksum
How to use checksums
339680b07410453f7678e6cdfa69b4a97dadf53d49c22aae9189e36cbb866106
BLAKE2b-256 checksum
How to use checksums
9323d858219e184e8d3254b93c268268bf55c5e44c15dbeb82dd72df30196f3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / livekit_plugins_readaloud-0.1.1-py3-none-any.whl

Download URL livekit_plugins_readaloud-0.1.1-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ffa45a3c9b5a5811000f191beb43cc95030638a5c4941149910b23f1c2d96373
BLAKE2b-256 checksum
How to use checksums
3f039614a59b2eb09b6eb30e404cefd83d8d1c96cc6cecf5eb65043d06e4f8cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page