KoljaB/RealtimeTTS

Converts text to speech in realtime

What it solves

RealtimeTTS addresses the high latency typically associated with text-to-speech (TTS) systems, making it suitable for conversational AI applications. It allows developers to convert strings, generators, and live LLM token streams into audio in real-time, reducing the gap between text generation and audible speech.

How it works

The library acts as a flexible wrapper around a vast matrix of TTS engines. It can process text inputs (including streaming chunks from an LLM) and feed them into a selected engine to produce audio. It supports local playback, streaming audio chunks to other processes, or saving output to WAV files. To minimize latency, it utilizes techniques like sentence splitting and supports high-performance engines like Qwen, which can run on GPU or CPU with optimized native runtimes.

Who it’s for

It is designed for Python developers building voice-enabled AI agents, conversational bots, and any application requiring low-latency, high-quality speech synthesis from dynamic text sources.

Highlights

  • Broad Engine Support: Integrates with local system voices, cloud APIs (OpenAI, Azure, ElevenLabs), and local neural models (Qwen, Coqui, Piper).
  • Low Latency: Optimized for streaming LLM output to ensure fast audible onset.
  • Voice Cloning: Supports x-vector and ICL voice cloning via compatible engines like Qwen.
  • Flexible Output: Supports local speaker playback, WAV file export, and muted synthesis.
  • Resilience: Includes fallback engine capabilities to ensure synthesis continues if a primary engine fails.

Related

  • Project
  • Project
  • Project
  • Project
  • Project