Skip to main content

Send Audio Message

Sends an audio file via the WhatsApp Business Cloud API. Audio files can be sent using a public URL or a Media ID from uploaded media.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs

  • Phone Number ID - WhatsApp Business Phone Number ID from Meta Developer Portal.
  • To Phone Number - Recipient's phone number with country code (without + sign). Example: 1234567890.
  • Audio URL - Public HTTPS URL of the audio or Media ID from uploaded media.

Options

  • API Version - Meta Graph API version. Default is 21.0.
  • Use Media ID - Set to true to use Media ID instead of URL. Default is false.
  • Access Token - WhatsApp Cloud API Access Token credential (required).

Output

  • Response - The complete API response object containing message details and status.

How It Works

The Send Audio Message node sends an audio file to a WhatsApp user. When executed, the node:

  1. Validates all required inputs
  2. Retrieves the access token from the credential
  3. Constructs the message payload with either URL or Media ID
  4. Sends a POST request to the WhatsApp API
  5. Returns the API response with message details

Requirements

  • A WhatsApp Business Account in Meta Developer Portal
  • Access Token with appropriate permissions
  • For URLs: Audio must be publicly accessible via HTTPS
  • For Media IDs: Media must be uploaded using Upload Media node
  • Audio must be in supported format and size

Supported Audio Formats

  • AAC (.aac, .m4a)
  • AMR (.amr)
  • MP3 (.mp3)
  • OGG (.ogg) - Opus codec

Maximum file size: 16 MB

Codec requirements:

  • AAC: AAC-LC codec recommended
  • OGG: Opus codec

Error Handling

The node will return specific errors in the following cases:

  • Empty or invalid Phone Number ID
  • Empty or invalid recipient phone number
  • Empty or invalid Audio URL
  • Audio URL not accessible
  • Audio URL not HTTPS
  • Audio exceeds size limit (16 MB)
  • Unsupported audio format or codec
  • Invalid Media ID
  • Invalid access token
  • Network connectivity issues

Example: Send Audio Message with URL

Inputs:

  • Phone Number ID: 123456789012345
  • To Phone Number: 14155551234
  • Audio URL: https://example.com/voice-message.mp3

Options:

  • Use Media ID: false

Example: Send Audio with Media ID

Flow:

  1. Upload Media node outputs Media ID: 5544332211
  2. Send Audio Message node:

Inputs:

  • Phone Number ID: 123456789012345
  • To Phone Number: 14155551234
  • Audio URL: 5544332211 (the Media ID)

Options:

  • Use Media ID: true

Example: Voice Notification

Use Case: Send automated voice notifications

Inputs:

  • Phone Number ID: 123456789012345
  • To Phone Number: {{customer.phone}}
  • Audio URL: {{voiceMessage.url}}

Description: Send pre-recorded voice messages for order confirmations, appointment reminders, or emergency alerts.

Usage Notes

  • Audio messages display as a playable audio player in WhatsApp
  • No caption support for audio messages (unlike images/videos)
  • Recipients can play audio inline without downloading
  • Audio quality is preserved but may be transcoded
  • Duration is automatically detected and displayed
  • Media IDs expire after 30 days
  • For voice recordings, use AAC or MP3 format

Tips for RPA Developers

  • Record audio in AAC or MP3 format for best compatibility
  • Keep audio files under 5 MB for faster delivery
  • Use mono audio (single channel) for voice messages
  • Sample rate of 16kHz or 22kHz is sufficient for voice
  • Use 64-128 kbps bitrate for voice, 128-256 kbps for music
  • Test audio playback on different devices
  • Use Upload Media node for local audio files
  • Consider text-to-speech services for dynamic audio content
  • Implement audio validation before sending

Audio Use Cases

Voice Messages:

  • Personal voice greetings
  • Customer service responses
  • Voice instructions or tutorials

Notifications:

  • Appointment reminders
  • Alert notifications
  • Confirmation messages

Music/Sound:

  • Promotional audio clips
  • Branded jingles
  • Product demonstrations

Audio Optimization

Using FFmpeg to optimize audio:

# Convert to AAC format
ffmpeg -i input.wav -c:a aac -b:a 64k output.m4a

# Convert to MP3
ffmpeg -i input.wav -c:a libmp3lame -b:a 64k output.mp3

# Reduce file size for voice
ffmpeg -i input.mp3 -ar 16000 -ac 1 -b:a 32k output.mp3

# Convert to OGG Opus
ffmpeg -i input.wav -c:a libopus -b:a 64k output.ogg

Common Errors and Solutions

Error: URL not accessible

  • Verify URL is publicly accessible
  • Ensure URL uses HTTPS
  • Check server allows external requests
  • Test URL in a browser or audio player

Error: Audio too large

  • Compress audio file
  • Maximum size is 16 MB
  • Reduce bitrate or sample rate
  • Use audio compression tools

Error: Unsupported format

  • Convert to AAC, MP3, AMR, or OGG
  • Use FFmpeg for conversion
  • Check file extension matches format
  • Verify codec compatibility

Error: Invalid Media ID

  • Media ID may have expired
  • Upload media again for fresh ID
  • Verify correct Media ID is used

Best Practices

  • Use AAC or MP3 for broad compatibility
  • Keep audio files under 5 MB
  • Use appropriate bitrate for content type:
    • Voice: 32-64 kbps
    • Music: 128-192 kbps
  • Test audio quality on mobile devices
  • Use mono for voice, stereo for music
  • Host audio on reliable CDN
  • Implement fallback to text if audio fails
  • Follow WhatsApp Business Policy
  • Don't send spam or unwanted audio
  • Consider user data costs (keep files small)

Text-to-Speech Integration

For dynamic audio content, integrate with TTS services:

Example Flow:

  1. Generate text message dynamically
  2. Convert text to speech using TTS API (Google TTS, Amazon Polly, etc.)
  3. Upload generated audio using Upload Media node
  4. Send audio using this node

Benefits:

  • Personalized voice messages
  • Multi-language support
  • Automated voice notifications
  • Consistent voice quality

Accessibility Considerations

  • Provide text alternative when possible
  • Consider users who can't play audio
  • Keep messages clear and concise
  • Use appropriate volume levels
  • Avoid background noise in voice recordings
  • Test with different audio devices