Skip to content

Generate Audio

During execution, the task sends literal text to the configured provider and model, and returns the generated audio as output, either as a URL or base64-encoded data. Use it to produce narration, voiceovers, or spoken responses as part of a workflow, or to feed generated audio into downstream tasks.

Prerequisites

Before using this task, you must have created an appropriate AI model integration in Orkes Conductor for your chosen provider (OpenAI, Google Gemini, or Google Vertex). Integrate the required provider with Orkes Conductor before configuring this task.

Task parameters

Configure these parameters for the Generate Audio task.

Parameter Description Required/ Optional
inputParameters.llmProvider The integration name of the AI model provider configured with your Conductor cluster. Required.
inputParameters.model The model or deployment name registered under the integration (e.g. tts-1, tts-1-hd). Required.
inputParameters.text The literal text to convert to audio. Required.
inputParameters.voice The voice to use for synthesis. Supported values are provider- and model-specific (e.g. alloy, nova for OpenAI). Optional.
inputParameters.speed Playback speed of the generated audio. Default is 1.0. Applies to OpenAI only. Optional.
inputParameters.responseFormat Output audio format, e.g. mp3, opus, aac, flac. Default is mp3. Optional.
inputParameters.n Number of audio outputs to generate. Default is 1. Optional.

The following are generic configuration parameters that can be applied to the task and are not specific to the Generate Audio task.

Caching parameters

You can cache the task outputs using the following parameters. Refer to Caching Task Outputs for a full guide.

Parameter Description Required/ Optional
cacheConfig.ttlInSecond The time to live in seconds, which is the duration for the output to be cached. Required if using cacheConfig.
cacheConfig.key The cache key is a unique identifier for the cached output and must be constructed exclusively from the task’s input parameters.
It can be a string concatenation that contains the task’s input keys, such as ${uri}-${method} or re_${uri}_${method}.
Required if using cacheConfig.
Other generic parameters

Here are other parameters for configuring the task behavior.

Parameter Description Required/ Optional
optional Whether the task is optional.

If set to true, any task failure is ignored, and the workflow continues with the task status updated to COMPLETED_WITH_ERRORS. However, the task must reach a terminal state. If the task remains incomplete, the workflow waits until it reaches a terminal state before proceeding.
Optional.

Task configuration

This is the task configuration for a Generate Audio task.

{
  "name": "generate_audio",
  "taskReferenceName": "generate_audio_ref",
  "inputParameters": {
    "llmProvider": "<YOUR-INTEGRATION-HERE>",
    "model": "<YOUR-MODEL-HERE>",
    "text": "<YOUR-TEXT-HERE>",
    "voice": "alloy",
    "responseFormat": "mp3"
  },
  "type": "GENERATE_AUDIO"
}

Task output

The Generate Audio task will return the following parameters.

Parameter Description
media Array of generated audio clips. Each element contains either a location (URL to the generated audio) or base64-encoded data, tagged with a mimeType such as audio/mpeg.

Examples

Here are some examples for using the Generate Audio task.

Using a Generate Audio task in a workflow
{
  "name": "generate_audio",
  "taskReferenceName": "audio",
  "inputParameters": {
    "llmProvider": "openai",
    "model": "tts-1",
    "text": "Hello, this is a test of text to speech.",
    "voice": "alloy"
  },
  "type": "GENERATE_AUDIO"
}