Text to Speech

Generate speech audio from a prompt when a trigger or event occurs and save locally or play via SIP.

Overview

Generate speech audio from a prompt when a trigger or event occurs and save locally or play via SIP.

Text to Speech

This node generates an audio file from a text prompt when a trigger or event occurs. The audio is saved locally on the filesystem, and the node outputs metadata indicating whether a new audio file was generated.

Inputs & Outputs

  • Input media: Raw Video.
  • Output media: Raw Video.
  • Output metadata: nodes.node_id.audio_generated_delta.

Properties

PropertyDescriptionTypeDefaultRequired
trigger_sourceGenerate audio from events generated by other nodes or a custom defined trigger. Options: Events from previous nodes (built_in); Custom Trigger (custom).enumcustomYes
triggerGenerate audio when this condition evaluates to true. Conditional on trigger_source being custom.trigger-conditionnullYes
intervalMin. time between consecutive generations. Unit: seconds.float10No
enabledEnabledbooltrueNo
prompt_sourcePrompt Source. Options: Static prompt (static); Metadata path (metadata_path).enumstaticYes
prompt_textStatic Prompt. Conditional on prompt_source being static.string""No
prompt_metadata_pathComma-separated metadata paths to extract prompt text. Conditional on prompt_source being metadata_path. Format: comma-separated metadata paths or patterns.string""No
tts_providerTTS Provider. Options: Lumeo Cloud (lumeo); ElevenLabs Cloud (elevenlabs); Local (local).enumlumeoYes
lumeo_voice_idVoice. Options: Male (male); Female (female). Conditional on tts_provider being lumeo.enummaleYes
local_voice_idRuns on the gateway's CPU with no cloud calls. English only; audio is always WAV. Options: Male (male); Male (assertive) (male_assertive); Female (female). Conditional on tts_provider being local.enummaleYes
local_speedSpeed. Options: Slower (slower); Slow (slow); Normal (normal); Fast (fast). Conditional on tts_provider being local.enumnormalNo
local_variabilityHow much the delivery varies. Up to 0.3 a prompt always sounds the same and repeats are replayed from cache; above 0.3 every playback is generated fresh and sounds a little different. Conditional on tts_provider being local. Range: minimum 0, maximum 1.4. Step: 0.1.float0.3No
elevenlabs_api_keyElevenLabs API Key. Conditional on tts_provider being elevenlabs.stringnullYes
elevenlabs_voice_idElevenLabs Voice ID. Conditional on tts_provider being elevenlabs.stringDXFkLCBUTmvXpp2QwZjAYes
elevenlabs_model_idElevenLabs Model ID. Conditional on tts_provider being elevenlabs.stringeleven_flash_v2_5No
audio_formatAudio Format. Options: MP3 (mp3); WAV (wav).enummp3No
sip_enabledWhen enabled, plays the generated audio to a SIP endpoint (e.g. a Hanwha speaker) via RTP. Audio format is forced to WAV when SIP is enabled.boolfalseYes
sip_ipSIP Endpoint IP. Conditional on sip_enabled being true.string""Yes
sip_portLeave blank to use the transport's standard port: 5060 for UDP and TCP, 5061 for TLS. Clear a saved 5060 when switching to TLS. Conditional on sip_enabled being true.numbernullNo
sip_transportTransport for SIP signaling. TLS encrypts signaling and accepts the endpoint's self-signed certificate. Audio (RTP) is always sent over UDP. Options: UDP (udp); TCP (tcp); TLS (SIPS) (tls). Conditional on sip_enabled being true.enumudpNo
sip_volumeLevel applied to the audio before it is played to the SIP endpoint. Options: Loud (normalized + soft limiter) (loud); Normalized (peak at -2 dBFS) (normalized); Original (original). Conditional on sip_enabled being true.enumloudNo
sip_media_encryptionEncrypts the audio with SRTP (AES_CM_128_HMAC_SHA1_80). The call fails if the endpoint won't use SRTP. Options: SRTP (srtp); None (none). Conditional on sip_transport being tls.enumsrtpNo
sip_usernameSIP user/extension on the endpoint (optional). Leave blank to call the endpoint by IP only. When set, it is sent in the To header first and the call is retried without it if the endpoint answers 403. Conditional on sip_enabled being true.string""No
sip_passwordSIP password (optional). Used with the SIP Username to answer 401/407 digest auth challenges. Conditional on sip_enabled being true.string""No

When SIP output is enabled, audio format is automatically forced to WAV. The node establishes a SIP call to the endpoint, streams the audio as G.711 u-law over RTP, then terminates the call. Packets are paced evenly in real time, and the call is held briefly so the endpoint finishes playing before hang-up.

The Local provider generates speech on the gateway's CPU with no cloud calls, in English with a male or female voice. Output is always WAV (24 kHz), or 8 kHz PCM when playing over SIP.

Generated audio is cached per prompt text, for static and metadata-driven prompts alike. When a prompt repeats, the cached file is replayed instead of calling the TTS provider again. Up to 100 files are kept; the least recently used is deleted first.

Output Metadata

The fields below are declared by this node's metadata schema; the JSON values are representative examples.

PathTypeDescription
nodes.<node_id>.audio_generated_deltabooleanWhen audio is generated
nodes.<node_id>.audio_filepathstringThe filepath of the audio file generated, present when audio is generated
nodes.<node_id>.typestringIdentifies the node type that produced this metadata.

JSON example

{
  "nodes": {
    "text_to_speech1": {
      "audio_filepath": "/path/to/output",
      "audio_generated_delta": false,
      "type": "text_to_speech"
    }
  }
}

Did this page help you?