MiniMax icon

MiniMax

Convert text to speech using MiniMax AI API

Overview

This node converts input text into speech audio using the MiniMax AI API. It is designed to transform textual content into an MP3 audio file, enabling automation workflows that require voice synthesis. Common use cases include generating audio versions of articles, creating voice prompts for IVR systems, or producing spoken notifications.

For example, you can input a paragraph of text and specify a voice ID to generate an MP3 audio file of that text spoken in the chosen voice. The node handles sending the request to the MiniMax API, processing the response, and outputting the audio data ready for further use or download.

Properties

Name Meaning
Text The text string to convert into speech. This is the content that will be synthesized.
Voice ID Identifier of the voice to use for speech generation. You must provide a valid voice ID.

Output

The node outputs an array of items, each containing:

  • json:

    • success (boolean): Indicates if the conversion was successful.
    • message (string): Success message or error description.
    • text (string): The original input text.
    • voiceId (string): The voice ID used for synthesis.
    • mimeType (string): Always "audio/mpeg" indicating MP3 format.
    • originalHexLength (number, optional): Length of the raw hex audio string received from the API.
    • bufferLength (number, optional): Length of the converted audio buffer.
    • extraInfo (object): Additional metadata returned by the API about the audio.
    • traceId (string): Trace identifier from the API response for debugging.
    • audioUrl (string, optional): URL to the audio file if provided by the API instead of raw audio data.
    • error (string, optional): Error message if the conversion failed.
    • Other diagnostic fields when errors occur.
  • binary:

    • data: Contains the MP3 audio data as binary, ready for playback or saving.

If the API returns raw audio data as a hex string, the node converts it into a binary MP3 file. If the API provides an audio URL, the node downloads the MP3 file and prepares it as binary data.

Dependencies

  • Requires an API key credential for authenticating with the MiniMax AI API.
  • The API host URL and group ID must be configured in the credentials.
  • The node uses HTTP POST requests to the MiniMax API endpoint /v1/t2a_v2.
  • The node expects the API to return either raw hex-encoded MP3 audio or a downloadable audio URL.

Troubleshooting

  • Invalid API Host: The API host URL must start with http or https. Check your credential configuration if you see "Invalid API Host in credentials".
  • Missing Group ID: The group ID is required for API calls. Ensure it is set in your credentials.
  • Text Required: Each item must have non-empty text; otherwise, the node throws an error.
  • Audio Conversion Failures: If the hex audio data cannot be converted to a valid MP3 buffer, the node logs a warning but attempts to proceed. Check the raw hex sample in the output for debugging.
  • Audio Download Failures: If the API returns an audio URL but the node fails to download it, check network connectivity and URL validity.
  • API Errors: The node surfaces API error messages returned in the response. Review these messages to adjust input parameters or credentials.
  • Continue on Fail: If enabled, the node continues processing subsequent items even if one fails, returning error details per item.

Links and References

Discussion