Zalo User Interact icon

Zalo User Interact

Gửi tin nhắn và tương tác với Zalo User

Overview

This node provides a Text-to-Speech (TTS) functionality, allowing users to convert input text into spoken audio using selectable voices and customizable speech parameters. It is useful in scenarios such as generating voice messages, creating audio content for accessibility, or automating announcements.

Typical use cases include:

  • Converting customer support responses into audio.
  • Creating narrated presentations or tutorials.
  • Generating voice alerts or reminders.
  • Producing audio versions of written content for visually impaired users.

For example, a user can input a Vietnamese text string and select a Vietnamese male neural voice to generate an audio file with specific pitch, rate, and volume settings.

Properties

Name Meaning
Text The text content to be converted into speech.
Voice The voice used for TTS synthesis. Options are dynamically loaded from available voices.
Rate Speech speed adjustment, e.g., "0%", "-10%", "+20%".
Volume Volume level adjustment, e.g., "0%", "-5%", "+10%".
Pitch Pitch adjustment of the voice, e.g., "0Hz", "-2Hz", "+3Hz".

Output

The node outputs JSON data containing the result of the TTS operation. This typically includes:

  • A field indicating success or failure.
  • The generated audio content encoded as a binary buffer or a reference to a saved audio file.
  • Metadata about the audio such as filename, format, or duration may also be included.

If binary data is output, it represents the synthesized speech audio, which can be used downstream for playback, storage, or further processing.

Dependencies

  • Requires access to a TTS service API that supports multiple voices and speech parameter customization.
  • Needs an API authentication token or key configured in n8n credentials to authorize requests.
  • Uses internal helper classes and methods to handle API communication and audio file management.
  • May require filesystem access if audio files are temporarily stored before output.

Troubleshooting

Common Issues

  • Invalid or missing API credentials: The node will fail to authenticate with the TTS service. Ensure that the API key or token is correctly set up in n8n.
  • Unsupported voice selection: If the selected voice is not available or incorrectly specified, the TTS request may error out. Use the provided voice options list.
  • Text input too long or empty: The TTS service might reject empty text or texts exceeding length limits.
  • Network or service errors: Temporary failures communicating with the TTS API can cause errors; retrying may help.

Error Messages and Resolutions

  • Authentication failed: Check API credentials and permissions.
  • Voice not found: Select a valid voice from the dropdown.
  • Text parameter missing: Provide non-empty text input.
  • Rate/Volume/Pitch invalid format: Use percentage strings like "0%", "+10%", or frequency strings like "0Hz".
  • File system write errors: Verify that n8n has permission to write temporary files if applicable.

Links and References


Note: Internal credential names and exact API details are omitted for security and abstraction purposes.

Discussion