LiveKit Agents Plugin for Resemble AI
Project Links
Meta
Author: LiveKit
Requires Python: >=3.10.0
Classifiers
Intended Audience
- Developers
License
- OSI Approved :: Apache Software License
Programming Language
- Python :: 3
- Python :: 3 :: Only
- Python :: 3.10
Topic
- Multimedia :: Sound/Audio
- Multimedia :: Video
- Scientific/Engineering :: Artificial Intelligence
Resemble plugin for LiveKit Agents
Support for voice synthesis with the Resemble AI API, using both their REST API and WebSocket streaming interface.
See https://docs.livekit.io/agents/integrations/tts/resemble/ for more information.
Installation
pip install livekit-plugins-resemble
Pre-requisites
You'll need an API key from Resemble AI. It can be set as an environment variable: RESEMBLE_API_KEY
Additionally, you'll need the voice UUID from your Resemble AI account.
Examples
Recommended
import asyncio
from livekit.plugins.resemble import TTS
async def run_tts_example():
# Use TTS with async context manager for automatic resource cleanup
async with TTS(
api_key="your_api_key", # or set RESEMBLE_API_KEY environment variable
voice_uuid="your_voice_uuid",
# Optional parameters
sample_rate=44100, # Sample rate in Hz (default: 44100)
precision="PCM_16", # Audio precision (PCM_32, PCM_24, PCM_16, MULAW)
output_format="wav", # Output format (wav or mp3)
) as tts:
# One-off synthesis (uses REST API)
audio_stream = tts.synthesize("Hello, world!")
# Process chunks as they arrive
async for chunk in audio_stream:
# Audio data is in the 'frame.data' attribute of SynthesizedAudio objects
audio_data = chunk.frame.data
print(f"Received chunk: {len(audio_data)} bytes")
# Alternative: collect all audio at once into a single AudioFrame
audio_stream = tts.synthesize("Another example sentence.")
audio_frame = await audio_stream.collect()
print(f"Collected complete audio: {len(audio_frame.data)} bytes")
# Real-time streaming synthesis (uses WebSocket API)
# Only available for Business plan users in Resemble AI
stream = tts.stream()
await stream.synthesize_text("Hello, world!")
# Run the example
asyncio.run(run_tts_example())
Alternative: Manual Resource Management
If you prefer to manage resources manually, make sure to properly clean up:
import asyncio
from livekit.plugins.resemble import TTS
async def run_tts_example():
# Initialize TTS with your credentials
tts = TTS(
api_key="your_api_key",
voice_uuid="your_voice_uuid",
)
try:
# TTS operations
audio_stream = tts.synthesize("Hello, world!")
async for chunk in audio_stream:
# Access audio data correctly
process_audio(chunk.frame.data)
finally:
# Always clean up resources when done
await tts.aclose()
# Run the example
asyncio.run(run_tts_example())
Resource Management
When using this plugin outside of the LiveKit agent framework, it's important to properly manage the TTS instance lifecycle:
- Preferred method: Use the async context manager pattern (
async with TTS(...) as tts:) - If managing manually, always call
await tts.aclose()in a finally block - If you prefer to provide your own HTTP session, you can pass it using the
http_sessionparameter:
import aiohttp
async def with_custom_session():
async with aiohttp.ClientSession() as session:
async with TTS(
api_key="your_api_key",
voice_uuid="your_voice_uuid",
http_session=session
) as tts:
# Use TTS...
# No need to manually close anything - context managers handle it all
Implementation Details
This plugin uses two different approaches to generate speech:
- One-off Synthesis - Uses Resemble's REST API for simple text-to-speech conversion
- Streaming Synthesis - Uses Resemble's WebSocket API for real-time streaming synthesis
The WebSocket streaming API is only available for Resemble AI Business plan users.
1.5.1
Mar 23, 2026
1.5.0
Mar 19, 2026
1.5.0rc2
Mar 06, 2026
1.5.0rc1
Feb 13, 2026
1.4.6
Mar 16, 2026
1.4.5
Mar 11, 2026
1.4.4
Mar 03, 2026
1.4.3
Feb 23, 2026
1.4.2
Feb 17, 2026
1.4.1
Feb 06, 2026
1.4.0rc2
Jan 23, 2026
1.4.0rc1
Dec 23, 2025
1.3.12
Jan 21, 2026
1.3.11
Jan 14, 2026
1.3.10
Dec 23, 2025
1.3.9
Dec 19, 2025
1.3.8
Dec 17, 2025
1.3.7
Dec 16, 2025
1.3.6
Dec 03, 2025
1.3.5
Nov 25, 2025
1.3.4
Nov 24, 2025
1.3.3
Nov 19, 2025
1.3.2
Nov 17, 2025
1.3.1
Nov 17, 2025
1.3.0rc2
Nov 15, 2025
1.3.0rc1
Nov 06, 2025
1.2.18
Nov 05, 2025
1.2.17
Oct 29, 2025
1.2.16
Oct 27, 2025
1.2.15
Oct 15, 2025
1.2.14
Oct 01, 2025
1.2.13
Oct 01, 2025
1.2.12
Sep 29, 2025
1.2.11
Sep 18, 2025
1.2.9
Sep 15, 2025
1.2.8
Sep 02, 2025
1.2.7
Aug 28, 2025
1.2.6
Aug 18, 2025
1.2.5
Aug 10, 2025
1.2.4
Aug 07, 2025
1.2.3
Aug 04, 2025
1.2.2
Jul 24, 2025
1.2.1
Jul 17, 2025
1.2.0
Jul 17, 2025
1.1.7
Jul 15, 2025
1.1.6
Jul 10, 2025
1.1.5
Jun 30, 2025
1.1.4
Jun 25, 2025
1.1.3
Jun 21, 2025
1.1.2
Jun 20, 2025
1.1.1
Jun 10, 2025
1.1.0
Jun 10, 2025
1.0.23
May 29, 2025
1.0.22
May 17, 2025
1.0.21
May 15, 2025
1.0.20
May 08, 2025
1.0.19
May 03, 2025
1.0.18
May 01, 2025
1.0.17
Apr 24, 2025
1.0.16
Apr 22, 2025
1.0.15
Apr 22, 2025
1.0.14
Apr 22, 2025
1.0.13
Apr 15, 2025
1.0.12
Apr 15, 2025
1.0.11
Apr 10, 2025
1.0.0rc9
Apr 07, 2025
1.0.0rc8
Apr 07, 2025
0.1.2
May 19, 2025
0.1.1
Apr 07, 2025
0.1.0
Apr 01, 2025
0.1.0rc1
Apr 07, 2025
Wheel compatibility matrix
Files in release
Extras:
None
Dependencies:
livekit-agents
(>=1.5.1)