Automations
Text-to-Speech Node
4 min readnode-ai-tts
Convert a text variable to an MP3 audio file using OpenAI TTS — use the audio URL in a WhatsApp voice note node downstream.
Text-to-Speech Node
Converts a text string to spoken MP3 audio using OpenAI's TTS API. The audio file is saved to the server and the URL is stored as a variable — pipe it into a WhatsApp Send Media node to send a voice note.
---
Fields
| Field | Required | Description | |||||
|---|---|---|---|---|---|---|---|
input | Yes | Text to synthesise. Max 4000 characters. Supports {{variables}} | |||||
voice | No | alloy | echo | fable | onyx | nova | shimmer (default: alloy) |
outputVar | No | Variable to store the audio URL (default: audioUrl) |
Requires: OPENAI_API_KEY environment variable set in your deployment.
---
Output
| Variable | Description |
|---|---|
{{variables.audioUrl}} | Relative URL to the MP3 file (e.g. /uploads/tts/tts-1234.mp3) |
---
Example: WhatsApp voice reply
whatsapp.received
→ ai.llm (generate response text → variables.reply)
→ ai.text_to_speech (input: {{variables.reply}} → variables.audioUrl)
→ wa.send_media (url: {{variables.audioUrl}}, mediaType: audio)
---
Voice guide
| Voice | Character |
|---|---|
alloy | Neutral, balanced — good general purpose |
echo | Deep, male-presenting |
fable | British accent, storytelling tone |
nova | Female, warm and conversational |
shimmer | Soft, gentle — good for support bots |