Analyze audio: tempo (BPM) and peaks
vivid_analyze_audioAnalyze an MP3/WAV for tempo, beat grid, and transient peaks to plan cuts and sync edits; returns BPM, beats/downbeats, and hit strengths.
Instructions
Tempo and transient analysis of a music / voice file, computed on the VIVID server (free, cached per asset). Returns bpm, firstBeatMs, the beat grid (beats[] / downbeats[] in ms from the start of the file, constant tempo) and peaks[] — the detected hits/accents/drops ({ms, strength 0–1}). Use beats for metronomic cuts and peaks for cuts on what the ear hears (dynamic montage, "tagli sui picchi"): pass them as clip boundaries (UPDATE_CLIP startMs/durationMs) or let CUT_TO_BEAT do it (grid beats|peaks). Input: VIVID asset id, public URL or local file (uploaded for you). MP3 or WAV only. First 90 s analysed by default.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | both | |
| source | Yes | Asset id (32 hex chars), http(s) URL, or local MP3/WAV path. | |
| bpmHint | No | Known tempo; fixes half/double-tempo detections. A "128 BPM" in the file name is picked up automatically. | |
| minGapMs | No | Minimum distance between two peaks (default 250 ms). Raise it (600–1500) for fewer, bigger accents. | |
| maxSeconds | No | Seconds analysed from the start (default 90). | |
| sensitivity | No | 0 = only the strongest hits … 1 = every small transient (default 0.5). |