Azure AI icon

Azure AI

Call Azure AI Cognitive Services — Document Intelligence, Content Safety, Translator, and Language

Speech → Text to Speech

AI-generated

Summary

Converts text to spoken audio with an Azure Neural voice via the Azure Speech TTS REST endpoint and writes the audio file to a binary property on each output item.

Inputs

  • authentication (required) — API Key (azureAiApi credential) or Entra ID OAuth2. Defaults to API Key.
  • azureRegion (required) — Azure region of the Speech resource (e.g. eastus). Used to build the host https://{region}.tts.speech.microsoft.com. The operation throws if it is empty.
  • ttsText (required) — Text to synthesize. Empty text throws an error. It is inserted into the SSML as-is without XML escaping, so characters like & or < may break the request.
  • ttsVoice (required) — Preset Azure Neural voice (Jenny, Guy, Aria, Sonia, Natasha, Denise, Katja, Elvira, Nanami, Xiaoxiao) or Custom. Defaults to en-US-JennyNeural.
  • ttsCustomVoice — Full voice name (e.g. pt-BR-FranciscaNeural). Shown and used only when Voice is Custom. The language is taken from the first 5 characters of the name.
  • ttsOutputFormat (required) — Audio format: MP3 24 kHz/160 kbps (default), MP3 16 kHz/128 kbps, OGG Opus 16 kHz, WAV 16 kHz PCM, or WAV 24 kHz PCM. All are mono.
  • ttsBinaryPropertyName (required) — Name of the binary property that receives the audio. Defaults to 'data'.

Output shape

One output item per input item. The audio is in the binary property named by Binary Property Name, as speech.mp3, speech.ogg or speech.wav depending on the format. The item's JSON holds metadata: voice, format, characterCount.

The JSON carries no transcript or audio data. The MIME type is audio/mpeg, audio/ogg or audio/wav. The Azure region must be set in the node parameter. Failures (empty text, no voice, missing region, HTTP errors) throw and stop the node unless Continue On Fail is handled, which this code does not do.

Examples

Example 1: Read a generated notification aloud as an MP3

Region=eastus, Text={{$json.message}}, Voice=en-US-JennyNeural, Output Format=MP3 24 kHz, Binary Property Name=data

Example 2: Generate Portuguese narration with a voice not in the preset list

Voice=Custom, Custom Voice Name=pt-BR-FranciscaNeural, Output Format=WAV 24 kHz PCM, Region=westeurope

Links

Discussion