Usage guide
Setup, environment variables, and Python/JavaScript/Go usage examples.
DeepgramTTS
Low-latency streaming text-to-speech via Deepgram’s Aura-2 Speak API. Natural English neural voices selected by model id (one voice per model).Constructor
Deepgram API key. Falls back to
DEEPGRAM_API_KEY.Voice override; when set, takes precedence over
model as the Aura voice id. Defaults to the model value.Aura-2 voice, e.g.
aura-2-andromeda-en, aura-2-thalia-en, aura-2-asteria-en, aura-2-zeus-en (16 English voices). Default "aura-2-andromeda-en".Output rate in Hz. Default 24000.
Stream audio as it is synthesized. Default True.
Output audio encoding. Default
"linear16".Deepgram Speak WebSocket endpoint.
aclose
emit
The event to emit.
interrupt
off
The event the handler was registered for.
The handler to remove.
on
callback is omitted.
The event to listen for.
The handler to invoke when the event is emitted. If
None, a decorator is returned that registers the decorated function.The registered callback when
callback is provided, otherwise a decorator that registers and returns the function it wraps.on_first_audio_byte
A callable, optionally async, invoked with synthesis timing information when the first audio byte is emitted.
synthesize
The text to synthesize; coerced to a string if needed.