Convert to WAV Callbacks
Webhook callback payload specification sent to your server when an audio format conversion task completes. Delivers the direct download link for high-resolution, broadcast-quality uncompressed WAV PCM audio.
When Callbacks Are Sent
The SongMesh API automatically triggers an HTTP POST request to your designated callBackUrl under these events:
- WAV Conversion Complete (code: 200): Dispatched once the lossy compressed MP3 track is decompressed and packaged into standard 44.1kHz/48kHz 16-bit PCM WAV audio.
- Decompression Failure (code: 400/500): Dispatched if the source audio link is inaccessible, expired, or invalid.
Webhook Payload Format
{
"code": 200,
"msg": "All generated successfully.",
"data": {
"task_id": "988ed45a192b48e3a245c8d3",
"audio_wav_url": "https://example.com/s/04e6a81b-9f12-4c22-98ab-e727_master.wav"
}
}Callback Payload Fields
| Field | Type | Description |
|---|---|---|
code | integer | HTTP status code of task processing (200 = Success, 400/500 = Error). |
msg | string | Status message indicating the conversion outcome (e.g. "All generated successfully."). |
data.task_id | string | Unique identifier of the WAV conversion task matching the taskId returned by POST /api/v1/createTask. |
data.audio_wav_url | string | Direct download URL for the uncompressed, broadcast-standard PCM WAV audio file. |
Receiver Implementation Example
const express = require('express');
const app = express();
app.use(express.json({ limit: '10mb' }));
app.post('/suno-convert-wav-callback', (req, res) => {
const { code, msg, data } = req.body;
const taskId = data?.task_id;
const wavUrl = data?.audio_wav_url;
console.log('Received WAV conversion callback:', {
taskId,
status: code,
message: msg
});
if (code === 200 && wavUrl) {
console.log('WAV conversion completed successfully!');
console.log(`WAV download link: ${wavUrl}`);
// Offload file transfer to storage worker
} else {
console.error('WAV conversion failed:', msg);
}
// Always return HTTP 200 within 15 seconds to acknowledge receipt
return res.status(200).json({ status: 'received' });
});
app.listen(3000, () => {
console.log('Convert to WAV callback server running on port 3000');
});Webhook Security Recommendation
Always verify incoming webhook payloads on your server. Respond with a 200 OK immediately after parsing the payload to prevent redundant delivery retries from the webhook dispatcher.
Broadcast Quality & Lossless Decompression
When requesting conversion via POST /api/v1/createTask (taskType: "convert_to_wav"), the audio processor decodes the compressed bitstream into linear PCM without dynamic range compression:
The converted file conforms to Red Book CD and digital audio workstation standards, ideal for film post-production and mastering.
The returned audio_wav_url provides high-bandwidth multi-threaded download throughput valid for 24 hours.
Webhook Delivery & Reliability Protocol
Webhook Receiver Examples
// app/api/webhook/suno-convert-wav/route.ts
import { NextRequest, NextResponse } from 'next/server';
interface ConvertWavCallbackPayload {
code: number;
msg: string;
data: {
task_id: string;
audio_wav_url?: string;
};
}
export async function POST(req: NextRequest) {
try {
const payload: ConvertWavCallbackPayload = await req.json();
const { code, msg, data } = payload;
const taskId = data?.task_id;
const wavUrl = data?.audio_wav_url;
console.log(`[Convert to WAV Webhook] Task ${taskId} -> Code: ${code}`);
if (code === 200 && wavUrl) {
console.log(`Lossless WAV ready for broadcast / studio mastering: ${wavUrl}`);
// Trigger background download to private S3 / OSS storage
} else {
console.error(`WAV conversion failed: ${msg}`);
}
// Always acknowledge receipt immediately with HTTP 200
return NextResponse.json({ code: 200, msg: 'success' });
} catch (error) {
console.error('Webhook error:', error);
return NextResponse.json({ code: 500, msg: 'Internal server error' }, { status: 500 });
}
}{
"code": 200,
"msg": "success"
}Ready to integrate Convert to WAV Callbacks?
Create your free account, obtain your Secret Key, and receive lossless WAV conversion notifications with 5 free generation credits.