Skip to main content

OpenAI Text to Speech

Convert text to audio using OpenAI's advanced Text to Speech models for various applications.

What is OpenAI Text to Speech?

A graphical interface of the 'OpenAI Text to Speech' tool is displayed, showing dropdown menus for 'Credentials', 'Model Name', and 'Voice', with 'Alloy' selected for voice. 'Prompt Text' has an empty text box, and 'Audio Output' is set to 'MP3'. Icons for settings and trash are visible at the top.

OpenAI Text to Speech allows you to convert text into audio using OpenAI's sophisticated Text to Speech models. This node needs an OpenAI API Key and a text prompt as inputs. You can choose from different models and voices to tailor the audio output to your needs. The output can be in various audio formats such as MP3, OPUS, AAC, FLAC, WAV, and PCM.

How to use it?

To effectively use OpenAI Text to Speech, follow these steps:

  1. Add OpenAI Text to Speech:

    • Drag and drop OpenAI Text to Speech into your workflow canvas.
  2. Configure Input Parameters:

    • Credentials: Select your OpenAI Credentials.
    • Model Name: Select a model from the available options (e.g., 'Text to Speech 1', 'Text to Speech 1 HD').
    • Voice: Choose a voice from the available options (e.g., 'Alloy', 'Echo', 'Fable', 'Onyx', 'Nova', 'Shimmer').
    • Audio Output: Select the desired audio format for the output (e.g., MP3, OPUS, AAC, FLAC, WAV, PCM).
  3. Connect Input Anchors:

    • Prompt Text: Connect a node that provides the text prompt input. For example, you can use a Text Input to provide the text.
  4. Set Output Anchors:

    • Connect a node which is able to store or the audio like a File Writer or do some further processing.

Example of usage

This example demonstrates how to set up a workflow that converts a text prompt into an MP3 audio file using the OpenAI Text to Speech.

A flowchart with three connected modules. The first is 'Text Input' with the text 'Create a list of Ideas for my Startup.' The second, 'OpenAI Text to Speech,' has settings for AI credentials and voice selection. The third, 'File Writer,' shows AWS S3 settings, file path 'idea-list.mp3,' and bucket name 'nocodo-test-data.'

Example Task: Text to Speech Conversion

Objective: Convert a given text into an audio file using OpenAI's Text to Speech service.

Step-by-Step Setup

  1. Add a Text Input:

    • Drag and drop a Text Input into the canvas.
    • Configure the template with the desired text (e.g., "Create a list of ideas for my startup").
  2. Add the OpenAI Text to Speech:

    • Drag and drop the OpenAI Text to Speech into the canvas.
    • Select your OpenAI Credentials.
    • Select the desired model (e.g., 'Text to Speech 1').
    • Choose a voice (e.g., 'Alloy').
    • Select 'MP3' as the audio output format.
  3. Connect Text Input to OpenAI Text to Speech:

    • Connect the output anchor of Text Input (prompt) to the input anchor of the OpenAI Text to Speech (Prompt Text).
  4. Add an Output:

    • Drag and drop a File Writer to the canvas to store the output.
    • Connect the audio output of the OpenAI Text to Speech to the input anchor of the File Writer.

Additional Information

For the best results with the OpenAI Text to Speech node, ensure that your API Key is valid and has the necessary permissions. Additionally, selecting the appropriate model and voice can significantly impact the quality of the generated audio. Refer to the OpenAI API documentation for further details on available models and voices.

By following these steps, you can effectively convert text to speech using OpenAI's Text to Speech services within your workflow.