Sources

Get the beats of an audio or video source

Changed on

Returns the tempo, every beat and every bar's first beat (downbeat) of an audio or video source owned by the caller or their workspace, in ms of source time. Each source is analyzed once and cached; the first request can take a few seconds, and answers 503 unavailable if the analysis is still running, so retry.

get/v1/sources/{sourceId}/beats

Request

Path parameters

sourceIdstring required

Streaming upload source identifier

Example:su_abc123def456

Response

OK

beatsMsnumber[] required

Every beat, in ms: on the video's playback timeline for background music (the same times as get_timeline), in source time for a source

beatsPerBarinteger required

Beats in each bar: 4, or 3 for a waltz-like meter

bpmnumber required

Tempo in beats per minute. 0 when the track has no beat at all

confidencenumber required

How clearly the track has a pulse, 0 to 1. Steady produced music is usually above 0.4; beatless ambient music below 0.1, where the beats are only a guess

downbeatsMsnumber[] required

The first beat of every bar, a subset of beatsMs. Cut or start a motion on these for the strongest musical accents

durationMsnumber required

Length of the timeline the beats are on: the video's playback duration for background music, the source's duration for a source

trackDurationMsnumber required

Length of one pass of the track. Background music restarts after it, so its beat grid restarts too

Example response

{
  "beatsMs": [
    512,
    1012,
    1512,
    2012
  ],
  "beatsPerBar": 4,
  "bpm": 120,
  "confidence": 0.86,
  "downbeatsMs": [
    512,
    2512
  ],
  "durationMs": 95200,
  "trackDurationMs": 180036
}

Changes