Skip to main content

Create Speech

Generates audio speech from text input using OpenAI's text-to-speech models.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs

  • Connection Id - The connection ID for the OpenAI service.
  • Input Text - The text to generate audio for. The maximum length is 4096 characters.
  • File Path to Save - The file path where the generated audio will be saved.

Options

  • Voice - The voice to use for speech generation. Options include:
    • alloy
    • echo
    • fable
    • onyx
    • nova
    • shimmer
  • Model - The OpenAI TTS model to use. Options include:
    • tts-1
    • tts-1-hd
  • Response Format - The audio format for the generated speech. Options include:
    • mp3
    • opus
    • aac
    • flac
  • Speed - The speed of the generated audio. Select a value from 0.25 to 4.0. 1.0 is the default.
  • Timeout (sec) - Timeout for the request. Only available with Robomotion Credits. Leave blank for default value (120+).

Output

This node does not have any output variables. The generated audio is saved directly to the specified file path.

How It Works

The Create Speech node uses OpenAI's text-to-speech models to convert text into audio speech. When executed, the node:

  1. Validates the provided Connection Id and file path
  2. Prepares the text-to-speech request with the specified options
  3. Sends the request to the selected OpenAI TTS model
  4. Receives the generated audio and saves it to the specified file path

Requirements

  • A valid OpenAI API key or Robomotion Credits
  • An active OpenAI connection
  • Input text to convert to speech
  • A valid file path for saving the generated audio

Error Handling

The node will return specific errors in the following cases:

  • Empty or invalid Connection Id
  • Empty or invalid File Path to Save
  • Empty or invalid Input Text
  • Invalid Speed value
  • OpenAI API errors
  • Timeout errors
  • File system errors when saving the audio file

Usage Notes

  • The default voice is "alloy" and the default model is "tts-1"
  • The default response format is "mp3"
  • For best results, keep input text under 4096 characters
  • The speed option allows fine-tuning of the speech tempo
  • When using Robomotion Credits, the timeout can be customized for better performance
  • The generated audio file will be saved at the specified file path