Async icon

Async

Interact with Async API

Actions4

Speech → Text to Speech

AI-generated

Summary

Converts text to speech and returns an audio binary file using the Async API.

Inputs

  • voice (required) — Selects the voice to use. Can be chosen from a list of available voices or specified by voice ID.
  • text (required) — The text to be converted into speech.
  • additionalOptions.outputContainer — Output audio format. Options: 'mp3' or 'wav'. Default is 'mp3'.
  • additionalOptions.sampleRate — Output audio sample rate in Hz. Default is 44100.
  • additionalOptions.encoding — Audio encoding format. Only used when 'outputContainer' is set to 'wav'. Options: 'pcm_s16le' (16-bit) or 'pcm_f32le' (32-bit). Default is 'pcm_s16le'.
  • additionalOptions.model — Model ID to use for the conversion. Default is 'async_flash_v1.0'.
  • additionalOptions.bitRate — Bit rate in kbps. Only used when 'outputContainer' is set to 'mp3'. Default is 192000.
  • requestOptions — Additional request options including batching, timeout, proxy, and SSL verification settings.

Output shape

A single binary audio item for each input text item, with the audio data stored in the 'binary.data' field.

The node returns an error if the API response is JSON instead of audio. The file extension is determined by the Content-Type header ('mp3' for audio/mpeg, 'wav' for other audio types).

Examples

Example 1: Convert a single text string to MP3 using the default voice and settings.

Text: 'Hello world', Output Container: 'mp3', Voice: Select from list

Example 2: Generate a WAV file with a specific sample rate and encoding.

Text: 'This is a test', Output Container: 'wav', Sample Rate: 48000, Encoding: 'pcm_s16le'

Example 3: Process multiple text items in batches to avoid rate limiting.

Text: [List of strings], RequestOptions: Batching enabled (50 items per batch, 1000ms interval)

Links

Discussion