LMNT
The LmntTTSService provides real-time, low-latency text-to-speech using LMNT's specialized models. It is optimized for high-speed conversational agents.
Installation
pip install "piopiy-ai[lmnt]"
Prerequisites
- An LMNT API key (Get yours here).
- Set your API key in your environment:
export LMNT_API_KEY="your_api_key_here"
Configuration
LmntTTSService Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
api_key | str | Required | Your LMNT API key. |
voice_id | str | Required | ID of the voice to use. |
model | str | "blizzard" | TTS model to use. |
language | Language | Language.EN | Language for synthesis. |
Usage
Basic Setup
import os
from piopiy.services.lmnt.tts import LmntTTSService
tts = LmntTTSService(
api_key=os.getenv("LMNT_API_KEY"),
voice_id="7990beeb-6da6-464a-8531-27d142d131f4"
)
Notes
- WebSocket Streaming: Uses a persistent WebSocket for sub-second synthesis.
- Flushing: Supports manual flushing to force immediate audio generation for pending text.