Retrieve waveform
Fetch the precomputed waveform peaks for a track, sound effect, or stem. Returns raw amplitude values you render in your own canvas/SVG.
GET/api/v4/music/waveforms/{audio_type}/{audio_id}/
Path parameters
| Parameter | Required | Description |
|---|---|---|
audio_type | Yes | One of track, soundfx, stem. |
audio_id | Yes | UUID of the asset. Must match audio_type (a track UUID for track, etc). |
Example request
curl "https://api.slipstreammusic.com/api/v4/music/waveforms/track/0328895e-af3f-4248-9173-69fed8ab25f5/"Example response
{
"data": [0.0, 0.012, 0.041, 0.118, 0.214, 0.301, 0.287, 0.176, 0.082, 0.024, ...],
"length": 12345,
"sample_rate": 44100,
"samples_per_pixel": 256,
"version": 2
}Response fields
| Field | Description |
|---|---|
data | Array of normalized amplitude values (typically in [-1, 1] or [0, 1] depending on version). One value per pixel of width when rendering at the encoded resolution. |
length | Number of entries in data. |
sample_rate | Audio sample rate in Hz (e.g., 44100). |
samples_per_pixel | How many original audio samples each data entry summarizes. Lower values = higher horizontal resolution; higher values = coarser/zoomed-out waveform. |
version | Waveform format version. Use it to switch decoding paths if Slipstream introduces new shapes in the future. |
Status codes
| HTTP | Body | When |
|---|---|---|
| 200 | Waveform JSON | Peaks are ready. |
| 202 | { "detail": "Waveform is being generated. Please try again in a few moments." } | First request for a newly added asset. The server kicked off generation; retry the same URL after a few seconds. |
| 400 | { "detail": "Model not found for audio type: ..." } | audio_type isn’t one of track, soundfx, stem. |
| 404 | — | The asset doesn’t exist for that audio_type. |
| 422 | { "detail": "Invalid waveform data format: ..." } | The peaks were generated but in an unexpected shape. Should be rare; report it. |
Rendering tips
- Cache the response per asset — peaks don’t change.
- Render in a
<canvas>or build SVG<path>M/Lcommands from thedataarray. - Use
samples_per_pixelto decide your zoom level. If you need a finer waveform than the response provides, downsample further on your side; the server returns peaks at a fixed resolution. - For stems, fetch each stem’s waveform individually — there’s no aggregate “stems” peaks call.
This endpoint is identical to what the slipstreammusic.com web player uses. Peaks are generated once per asset by an offline worker and cached.