API ReferenceWaveformsRetrieve waveform

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

ParameterRequiredDescription
audio_typeYesOne of track, soundfx, stem.
audio_idYesUUID 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

FieldDescription
dataArray 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.
lengthNumber of entries in data.
sample_rateAudio sample rate in Hz (e.g., 44100).
samples_per_pixelHow many original audio samples each data entry summarizes. Lower values = higher horizontal resolution; higher values = coarser/zoomed-out waveform.
versionWaveform format version. Use it to switch decoding paths if Slipstream introduces new shapes in the future.

Status codes

HTTPBodyWhen
200Waveform JSONPeaks 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.
404The 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/L commands from the data array.
  • Use samples_per_pixel to 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.