Rime integration guide

An introduction to using the LiveKit Agents framework with Rime TTS.

Overview

Rime provides text-to-speech synthesis (TTS) optimized for speed and quality. With LiveKit's Rime integration and the Agents framework, you can build AI voice applications that are responsive and sound realistic.

Note

If you're looking to build an AI voice assistant with Rime, check out our Voice Agent Quickstart guide and use the Rime TTS module as demonstrated below.

Quick reference

The following sections provide a quick reference for integrating RIME TTS with LiveKit. For the complete reference, see the links provivded in each section.

TTS

LiveKit's Rime integration provides a text-to-speech (TTS) interface. This can be used in a VoicePipelineAgent or as a standalone speech generator.

Usage

Create an instance of Rime TTS:

from livekit.plugins.rime import TTS
rime_tts = TTS(
model="mist",
speaker="rainforest",
speed_alpha=0.9,
reduce_latency=True,
)

Parameters

This section describes some of the available parameters. For a complete reference of all available parameters, see the plugin reference.

modelstringOptionalDefault: mist

ID of the model to use. To learn more, see Models.

speakerstringOptionalDefault: lagoon

ID of the voice to use for speech generation. To learn more, see Voices.

audio_formatTTSEncodingOptionalDefault: pcm

Audio format to use. Valid values are: pcm and mp3.

sample_rateintegerOptionalDefault: 16000

Sample rate of the generated audio. Set this rate to best match your application needs. To learn more, see Recommendations for reducing response time.

speed_alphafloatOptionalDefault: 1.0

Adjusts the speed of speech. Lower than 1.0 results in faster speech; higher than 1.0 results in slower speech.

reduce_latencybooleanOptionalDefault: false

When set to true, turns off text normalization to reduce the amount of time spent preparing input text for TTS inference. This might result in the mispronunciation of digits and abbreviations. To learn more, see Recommendations for reducing response time.

phonemize_between_bracketsbooleanOptionalDefault: false

When set to true, allows the use of custom pronunciation strings in text. To learn more, see Custom pronunciation.

api_keystringOptionalEnv: RIME_API_KEY

Rime API Key.