Wyoming Protocol
Speech to Text (STT)
AI-generatedOverview
This node implements the Wyoming protocol to perform either Speech-to-Text (STT) or Text-to-Speech (TTS) operations by connecting to compatible servers such as Whisper for STT or Piper for TTS. It is designed to convert audio input into text transcriptions or synthesize text input into audio output.
Common scenarios:
- Transcribing recorded voice messages, podcasts, or interviews into text for further processing or analysis.
- Generating spoken audio from textual content for accessibility, voice assistants, or automated announcements.
- Integrating speech recognition or synthesis capabilities into automation workflows without relying on cloud services.
Practical examples:
- Automatically transcribe customer support calls and store the text in a database.
- Convert chatbot responses into natural-sounding audio for phone-based interactions.
- Process audio files uploaded by users and extract their content as searchable text.
Properties
| Name | Meaning |
|---|---|
| Language | Language code for STT transcription (e.g., "en", "de", "fr", "en-us"). Specifies the language model to use. Required for STT. |
| Timeout (Ms) | Maximum time in milliseconds to wait for the entire operation including connection, processing, and response. |
| Input Binary Field (Audio) | Name of the binary field containing the input audio data for STT. Supported formats depend on installed ffmpeg (MP3, WAV, etc.). |
| Output Field Name (Text) | Field name where the resulting transcribed text will be stored after STT. |
Output
For Speech to Text (STT):
- The node outputs JSON data with the original input fields plus an additional field (name configurable) containing the transcribed text string.
- No binary data is output in this mode.
For Text to Speech (TTS) (not requested but present in code):
- Outputs binary WAV audio data with a proper WAV header added.
- The audio is PCM format, 16 kHz sample rate, 16-bit depth, mono channel.
- The binary data is stored under a configurable output field name.
Dependencies
- Requires a running Wyoming-compatible server (e.g., Whisper for STT).
- Requires an API key credential for authenticating with the Wyoming server.
- Requires
ffmpeginstalled and accessible in the system PATH for audio conversion during STT. - Uses Node.js standard modules for TCP socket communication and child process spawning.
Troubleshooting
No binary data found in input field:
Ensure the specified input binary field contains valid audio data. Check that the binary property exists and is not empty.FFmpeg errors:
Errors during audio conversion may indicate missing or misconfiguredffmpeg. Confirmffmpegis installed and available in PATH. Also verify input audio format compatibility.Invalid server address or port:
The server host and port must be provided in the formathost:port. Ports must be valid numbers between 1 and 65535.Timeouts:
If the operation exceeds the configured timeout, it will abort. Increase the timeout if processing large audio files or slow network conditions.Connection errors (ECONNREFUSED, ENOTFOUND, EHOSTUNREACH):
These indicate network or configuration issues connecting to the Wyoming server. Verify server availability and credentials.Empty transcription result:
If transcription finishes without producing text, check the audio quality and supported languages.Error events from server:
Server-side errors are reported with descriptive messages. Review server logs and ensure correct parameters like language codes.continueOnFail behavior:
If enabled, the node records errors per item and continues processing other items; otherwise, it stops workflow execution on errors.
Links and References
- Wyoming Protocol Documentation (general reference, if available)
- FFmpeg Official Site — for installation and usage details
- n8n Documentation — general guidance on custom nodes and error handling
Note: This summary is based solely on static analysis of the provided source code and property definitions. Runtime behavior depends on external server implementations and environment setup.