Detailed guide on how to use the Play Audiofeature of Alohub on n8n — make outbound calls and play pre-recorded audio files (MP3, WAV, M4A) to customers.
Requirements:Node installed
n8n-nodes-alohuband API Key credential set up. See Installation guideif not done yet.
Play Audio allows Alohub to make outbound calls and play available audio filesto customers. Unlike Text to Speech (synthesized voice), Play Audio uses real audio files provided by you— suitable when you need to:
Play professionally recorded advertising messagesPlay
jingles, brand hold musicPlay announcements in
real human voice, with more natural emotion than TTSPlay
Phát multilingual content(English, Chinese, Korean...) when TTS is not supported
Format | Extension | Recommendation |
|---|---|---|
MP3 |
| Common, small size — recommended |
WAV |
| High quality, large size |
M4A |
| Apple format, good for files recorded from iPhone |
Drag the Alohubnode into the workflow canvas
Select Credential: Alohub account created
Select Resource: Voice
Select Operation: Play Audio
Select Audio Source: how to obtain the audio file (URL or Binary Data)
Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| string | Yes |
| Phone number receiving the call |
| enum | Yes |
| How to provide the audio file |
| string | If URL is selected |
| Direct link to the audio file |
| string | If Binary is selected |
| Name of the binary property from the previous node |
Suitable when you have uploaded the file to a location with a public link (CDN, S3, Google Drive public...). The node will automatically download the file and send it to Alohub.
Tip:This is the most stable way— the file is sent intact, avoiding audio distortion due to encode/decode when passing through multiple nodes.
With Google Drive: get the file share link, then convert it to a direct download link:
# Link share gốc:
https://drive.google.com/file/d/FILE_ID/view?usp=sharing
# Đổi thành link download trực tiếp:
https://drive.google.com/uc?export=download&id=FILE_IDSuitable when the file comes from another node in the workflow (Google Drive node, HTTP Request, Read Binary File, Email Attachment...).
Configuration:
Field Binary Property: enter the name of the property containing the binary file (usually data— the default name of n8n)
The previous node must output binary data in the same named property
Note:Some WAV files may be altered when passing through n8n's binary pipeline. If you encounter audio distortion, switch to Audio Source: URLor change to an MP3 file.
https://xapi.alohub.vn/v1/voice/tts/audioThe node sends a request in multipart/form-datawith 2 fields:
Field | Type | Description |
|---|---|---|
| text | Receiving phone number |
| file | Audio file (MP3/WAV/M4A) |
On success:
{
"success": true,
"httpStatus": 200,
"transactionId": "ah_n8n_a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"resource": "voice",
"operation": "playAudio",
"timestamp": "2026-04-15T09:00:00.000Z",
"error_code": "SUCCESS",
"error_message": "SUCCESS"
}On error:
{
"success": false,
"httpStatus": 400,
"transactionId": "ah_n8n_...",
"error_code": "0",
"error_message": "File audio không hợp lệ",
"errorCode": "0",
"errorMessage": "File audio không hợp lệ"
}[Manual Trigger] → [Alohub: Voice > Play Audio]
Phone Number: 0912345678
Audio Source: URL
Audio URL: https://cdn.alohub.vn/audio/promo.mp3[Schedule Trigger] → [Google Drive: Download File] → [Alohub: Voice > Play Audio]
Phone Number: 0912345678
Audio Source: Binary Data
Binary Property: data[Schedule Trigger 9AM] → [Database: Get Overdue Customers] → [Loop: For Each] → [Alohub: Voice > Play Audio]
Phone Number: {{ $json.phone }}
Audio Source: URL
Audio URL: https://cdn.alohub.vn/audio/payment-reminder.mp3[Email Trigger] → [Extract Attachment (MP3)] → [Alohub: Voice > Play Audio]
Phone Number: {{ $json.recipient_phone }}
Audio Source: Binary Data
Binary Property: attachment_0Play Audio can be used as a tool for AI Agent — suitable for scenarios where AI selects the appropriate audio file based on the conversation content with customers.
Drag the When chat message received→ connect to AI Agent
Add Chat Model(OpenAI / Claude / Gemini)
Add Tool: select Alohub Tool
Configure Alohub Tool:
Field | Value | Explanation |
|---|---|---|
Resource |
| — |
Operation |
| — |
Phone Number |
| AI extracts the phone number automatically |
Audio Source |
| Fixed as URL |
Audio URL |
| AI selects the appropriate file from the library |
# Người dùng gõ:
"Gọi cho khách 0912345678 phát thông báo khuyến mãi"
# AI Agent tự động:
# 1. Nhận diện cần gọi Voice > Play Audio
# 2. Trích xuất phoneNumber = "0912345678"
# 3. Chọn URL file: https://cdn.alohub.vn/audio/promo.mp3
# 4. Gọi Alohub Tool → thực hiện cuộc gọi + phát file
# 5. Trả kết quả cho người dùngError code | Message | Cause | How to handle |
|---|---|---|---|
| Required request part 'file' is not present | File not uploaded to the API | Check Binary Property name or URL |
| Authorization failed | Invalid API Key | Check Credential again |
— | Audio file has distortion | WAV through binary pipeline has altered encoding | Switch to Audio Source: URL or change to MP3 |
— | Unable to download file from URL | URL is not a direct download link | Ensure the URL returns a binary file, not HTML |
Recommendation:Host audio files on your CDN or object storage service (AWS S3, Cloudflare R2, Bunny CDN) to ensure the highest speed and stability.
Criteria | Play Audio | Text to Speech |
|---|---|---|
Voice quality | Natural (real human voice) | Synthesized (machine reading) |
Personalization | Cannot insert dynamic data | Can insert name, amount, OTP... |
Preparation cost | Requires effort to record in advance | Just need to write text |
Suitable for | Advertising, jingles, fixed content | OTP, personalized announcements |