Wyoming Protocol icon

Wyoming Protocol

Performs Speech-to-Text (STT) or Text-to-Speech (TTS) using the Wyoming protocol. Connects to servers like Piper (TTS) or Whisper (STT). Requires 'ffmpeg' for STT audio conversion. STT Input: Various formats (MP3, WAV, Ogg, etc.). STT Output: Text. TTS Input: Text. TTS Output: WAV Audio (PCM, 16kHz sample rate, 16-bit depth, Mono channel internally).

Text to Speech (TTS)

AI-generated

Overview

This node implements the Wyoming protocol to perform either Text-to-Speech (TTS) or Speech-to-Text (STT) operations by connecting to compatible servers such as Piper for TTS or Whisper for STT. It is designed to convert input text into synthesized speech audio or transcribe spoken audio into text.

Common scenarios where this node is beneficial include:

  • Generating audio responses from text content, e.g., creating voice messages or announcements.
  • Transcribing recorded audio files or live audio streams into text for analysis, captioning, or indexing.
  • Integrating speech synthesis or recognition capabilities into automation workflows without relying on cloud services.

Practical examples:

  • Converting chat messages into spoken audio for accessibility or telephony applications.
  • Transcribing customer support calls or voice notes into searchable text.
  • Creating audio versions of articles or notifications dynamically.

Properties

Name Meaning
Timeout (Ms) Maximum time in milliseconds to wait for the entire operation including connection, processing, and response. Minimum 1000 ms. Default: 60000 ms.
Input Text Field Text string to be synthesized into speech. Supports expressions to dynamically provide text per item. Required for TTS operation.
Voice Name/ID Optional voice identifier or name for TTS synthesis. If left empty, the server's default voice is used. Check your TTS server documentation for available voices.
Output Field Name (Audio) The field name where the resulting synthesized audio will be stored as binary WAV data. MIME type: audio/wav. Required for TTS operation.

Output

The node outputs an array of items corresponding to each input item processed.

  • For Text to Speech (TTS):

    • The output contains the original JSON data plus a binary field with the specified name containing the synthesized speech audio in WAV format (PCM, 16 kHz sample rate, 16-bit depth, mono channel).
    • The binary data can be used downstream for playback, storage, or further processing.
  • For Speech to Text (STT) (not requested here but supported by the node):

    • Outputs JSON with a field containing the transcribed text.

If synthesis fails or produces no audio, the output item will contain the original JSON without the audio binary field.

Dependencies

  • Requires a running Wyoming-compatible server (e.g., Piper for TTS) accessible via TCP with host and port configured through credentials.
  • Requires ffmpeg installed and available in the system PATH for audio conversion during STT operations (not applicable for TTS).
  • Needs an API key or authentication token credential configured in n8n to connect securely to the Wyoming server.
  • Node uses internal buffering and TCP socket management to communicate with the server using the Wyoming protocol.

Troubleshooting

  • Invalid Server Address: The server address must be in host:port format with a valid port number (1-65535). Errors here indicate misconfiguration.
  • Connection Errors: Errors like connection refused, host not found, or unreachable host suggest network issues or incorrect server details.
  • Timeouts: If the operation exceeds the configured timeout, it aborts with a timeout error. Increase the timeout if processing large inputs or slow servers.
  • Empty Input Text: For TTS, providing empty or missing input text causes an error. Ensure the input text parameter is set correctly.
  • No Audio Data Returned: If the server returns no audio data, the node warns and outputs the item without audio. This may indicate server-side issues or unsupported input.
  • FFmpeg Errors: Although mainly for STT, ffmpeg errors indicate missing installation or invalid audio formats. For TTS, ffmpeg is not used.
  • Server Error Events: The node surfaces server-side errors with descriptive messages. Check server logs and configuration if these occur.
  • Continue On Fail Behavior: If enabled, the node records errors per item and continues processing; otherwise, it stops workflow execution on errors.

Links and References

Discussion