Skip to main content

LMNT TTS

LMNTTTS calls LMNT’s /v1/ai/speech/bytes endpoint. The Patter port defaults to format: "raw" (PCM_S16LE) at 16 kHz for direct telephony use; callers can switch to mp3, mulaw, wav, aac when needed.

Install

npm install getpatter
No vendor SDK is required — LMNTTTS uses the platform fetch, so it works on Node 18+.

Usage

import { LMNTTTS } from "getpatter";

const tts = new LMNTTTS(process.env.LMNT_API_KEY!, {
  model: "blizzard",
  voice: "leah",
  // language omitted -> defaults to "auto" for blizzard, "en" for aurora
  format: "raw",
  sampleRate: 16000,
  temperature: 1.0,
  topP: 0.8,
});

for await (const chunk of tts.synthesizeStream("Hello from Patter.")) {
  // chunk is a Buffer of PCM_S16LE audio
}
Prefer one-shot synthesis? Use await tts.synthesize(text) to collect the stream into a single Buffer.

Options

OptionDefaultNotes
model"blizzard""blizzard" or "aurora".
voice"leah"LMNT voice id.
languageundefinedAuto-derived from model when omitted.
format"raw""aac", "mp3", "mulaw", "raw", "wav".
sampleRate160008000, 16000, or 24000.
temperature1.0Higher = more expressive.
topP0.8Controls stability.
baseUrlLMNT /v1/ai/speech/bytesOverride for proxying or self-hosted gateways.

Attribution

Ported from LiveKit Agents (livekit-plugins-lmnt, Apache License 2.0).