Usage guide
Setup, environment variables, and Python/JavaScript/Go usage examples.
HumeAITTS
Hume AI TTS provider: expressive, emotion-aware speech synthesis via Hume’s Octave model. Uses Hume AI’s/v0/tts (Octave) endpoint, which supports both
predefined library voices and user-designed or cloned voices. Voices can
be specified by name (Hume AI library or custom) or by UUID. The API
outputs audio at a fixed 48 kHz sample rate; the sample_rate argument
controls the advertised rate, not the wire format.
Constructor
Hume AI API key. Falls back to the
HUMEAI_API_KEY environment variable when None.Voice name or UUID. Can be a name from Hume’s built-in voice library (e.g.
"Serene Assistant", "Male English Actor"), the name of a custom saved voice, or a UUID string (e.g. "9e068547-5ba4-4c8e-8e03-69282a008f04"). Browse available voices at app.hume.ai/voices or via the GET /v0/tts/voices/list endpoint. Defaults to "Serene Assistant".Speaking speed multiplier on a non-linear scale from
0.5 (much slower) to 2.0 (much faster), where 1.0 is normal pace. Changes are not strictly proportional to the multiplier value. Defaults to 1.0.Advertised output sample rate in Hz. Note: Hume AI’s API always returns audio at 48 kHz regardless of this value. 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.