Skip to main content

LMNT 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

ParameterTypeDefaultDescription
api_keystrRequiredYour LMNT API key.
voice_idstrRequiredID of the voice to use.
modelstr"blizzard"TTS model to use.
languageLanguageLanguage.ENLanguage 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.