Skip to content
Docs

LMNT Voice Provider

LMNT provides ultra-low-latency text-to-speech synthesis optimized for real-time voice applications. The Beluga AI provider uses the LMNT Speech API for synthesis, supporting configurable voice selection, output format, and speech speed.

Choose LMNT when you need the lowest possible TTS latency for real-time conversational agents. LMNT is purpose-built for speed, making it a strong choice for voice pipelines where response time is the primary concern. For broader voice variety or voice cloning, consider ElevenLabs or PlayHT.

import _ "github.com/lookatitude/beluga-ai/voice/tts/providers/lmnt"

The blank import registers the "lmnt" provider with the TTS registry.

FieldTypeDefaultDescription
Voicestring"lily"LMNT voice identifier
FormatAudioFormatOutput audio format
Speedfloat64Speech rate multiplier (1.0 = normal)
ExtraSee below
KeyTypeRequiredDescription
api_keystringYesLMNT API key
base_urlstringNoOverride base URL
package main
import (
"context"
"log"
"os"
"github.com/lookatitude/beluga-ai/voice/tts"
_ "github.com/lookatitude/beluga-ai/voice/tts/providers/lmnt"
)
func main() {
ctx := context.Background()
engine, err := tts.New("lmnt", tts.Config{
Voice: "lily",
Extra: map[string]any{"api_key": os.Getenv("LMNT_API_KEY")},
})
if err != nil {
log.Fatal(err)
}
audio, err := engine.Synthesize(ctx, "Hello, welcome to Beluga AI.")
if err != nil {
log.Fatal(err)
}
if err := os.WriteFile("output.wav", audio, 0644); err != nil {
log.Fatal(err)
}
}
import "github.com/lookatitude/beluga-ai/voice/tts/providers/lmnt"
engine, err := lmnt.New(tts.Config{
Voice: "lily",
Extra: map[string]any{"api_key": os.Getenv("LMNT_API_KEY")},
})

The streaming interface synthesizes each text chunk independently:

for chunk, err := range engine.SynthesizeStream(ctx, textStream) {
if err != nil {
log.Printf("error: %v", err)
break
}
transport.Send(chunk)
}
processor := tts.AsFrameProcessor(engine, 24000, tts.WithVoice("lily"))
pipeline := voice.Chain(sttProcessor, llmProcessor, processor)
audio, err := engine.Synthesize(ctx, "Hello!",
tts.WithVoice("daniel"),
tts.WithSpeed(1.5),
)
engine, err := tts.New("lmnt", tts.Config{
Voice: "lily",
Extra: map[string]any{
"api_key": os.Getenv("LMNT_API_KEY"),
"base_url": "https://lmnt.internal.corp/v1",
},
})