Usage guide
Setup, environment variables, and Python/JavaScript/Go usage examples.
InworldAITTS
Inworld AI TTS provider: realtime, low-latency text-to-speech via Inworld’s voice API. Wraps Inworld AI’sPOST /tts/v1/voice endpoint. Supports both
quality-optimised and latency-optimised model variants, instant voice
cloning, and multilingual output. Audio is returned as base64-encoded MP3
by default; sample_rate controls the advertised output rate.
Constructor
Inworld AI API key. Falls back to the
INWORLDAI_API_KEY environment variable when None.Voice identifier for synthesis. Use any voice ID available in the Inworld AI voice library (e.g.
"Hades", "Sarah"), or a custom voice UUID obtained from the /voices/v1/voices:clone endpoint. Voice IDs are consistent across the TTS API and the Inworld Playground. Defaults to "Hades".TTS model to use. Options include
"inworld-tts-1.5-max" (optimised for quality) and "inworld-tts-1.5-mini" (~120 ms median latency, optimised for speed). Defaults to "inworld-tts-1".Output audio sample rate in Hz. The API supports values in the range 8000–48000 Hz via the
sampleRateHertz audio config field. Defaults to 24000.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.