Endpoint
Query parameters
Response
data field contains an array of normalized amplitude values (0.0 to 1.0) sampled at regular intervals across the clip duration.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Get waveform amplitude data for audio visualization
GET /api/v1/music/waveform?clip_id={clip_id}
| Parameter | Type | Required | Description |
|---|---|---|---|
clip_id | string | Yes | Clip ID to retrieve waveform for. Obtain from Upload Audio (data.clipId) or a completed generation task (results[].id). |
{
"code": 0,
"message": "ok",
"request_id": "req-1710000000000",
"data": [0.12, 0.45, 0.78, 0.56, 0.34, ...]
}
data field contains an array of normalized amplitude values (0.0 to 1.0) sampled at regular intervals across the clip duration.
curl "https://api.example.com/api/v1/music/waveform?clip_id=abc123def456" \
-H "Authorization: Bearer sk-mm-your-key"
function drawWaveform(canvas, amplitudes) {
const ctx = canvas.getContext('2d');
const w = canvas.width, h = canvas.height;
amplitudes.forEach((amp, i) => {
const x = (i / amplitudes.length) * w;
const barH = amp * h;
ctx.fillRect(x, (h - barH) / 2, 1, barH);
});
}