# BPM Detector

Find a track's tempo and the position of every beat, in the browser.

Runs entirely in the browser through WebCodecs and WebAssembly. No upload, no account, no size limit
imposed by a plan, no watermark — because there is no server involved.

Page: https://life2film.com/tools/bpm-detector/

## What matters

- Takes mono f32 PCM, which is exactly what AudioContext.decodeAudioData gives you.
- Analyse at 22050 Hz: the onset envelope lives far below that, and the source rate costs several times the memory for the same answer.
- Exports the beat grid as EDL, OTIO, FCPXML, Audacity labels, CSV or JSON.
- Tempo is genuinely ambiguous (140 BPM is also 70 in half time) so both readings are shown.
- Verified against a synthetic 120 BPM file: reads 120.0 and finds 24 beats in 12 seconds.

## From code

```js
const engine = await import('https://life2film.com/wasm/va_wasm.js');
await engine.default({ module_or_path: 'https://life2film.com/wasm/va_wasm_bg.wasm' });

const ctx = new AudioContext();
const buffer = await ctx.decodeAudioData(await file.arrayBuffer());

// Down-mix to mono at 22050 Hz first (OfflineAudioContext), then:
const { bpm, beats } = JSON.parse(engine.detect_beats(mono, 22050, null));
```

## Questions

**Does my audio get uploaded anywhere?**

No. The analysis runs inside your browser as WebAssembly. The file is read from disk into memory and never sent over the network, you can check by opening the network tab, or by pulling the plug once the page has loaded.

**How accurate is it?**

It uses onset-strength analysis with dynamic-programming beat tracking: the same approach behind established music-information-retrieval tooling, and the same code that drives Life2Film’s montage engine. On music with a steady pulse it lands within a beat of the truth. On rubato, live recordings without a click, or heavily syncopated material, treat the number as a starting point.

**What does “half or double tempo” mean?**

Tempo is ambiguous by nature: a track at 140 BPM is also, correctly, 70 BPM counted in half time. Detectors pick whichever is stronger in the signal. If the number feels off by exactly 2×, that is what happened, and both answers are shown so you can take the one you need.

**Which formats work?**

Whatever your browser can decode: MP3, WAV, M4A, AAC, FLAC and OGG in current Chrome, Edge, Safari and Firefox. Video files work too, the audio track is what gets read.

**Can I use the beat times in my editor?**

That is what the export is for. EDL is the one to pick for DaVinci Resolve or Premiere Pro, each beat arrives as a named marker on the timeline. Final Cut takes the FCPXML. OTIO works in Resolve, Avid and Premiere too, and is the right choice if the beats are heading into a pipeline rather than straight onto a timeline. Audacity reads the label export, and CSV or JSON cover spreadsheets and scripts.

**Why does the frame rate matter?**

Beats fall on fractions of a second; timelines count whole frames. Every marker has to be rounded to the nearest frame of the project it is going into, so a grid exported at 25 fps will sit up to 20 ms off in a 30 fps sequence. Set the rate to match your project and the markers land exactly where the beat is. It does not affect CSV or JSON, which carry raw seconds as well.

## Related

- [Trim Video](https://life2film.com/tools/video-trimmer/): Drag the handles to the part you want, preview it, save it. Audio stays in sync.
- [Compress Video](https://life2film.com/tools/video-compressor/): Make a file smaller and see exactly what it cost. No size limit, because there is no server.
- [Video to MP3](https://life2film.com/tools/video-to-mp3/): Pull the audio out of a video and keep it as MP3, WAV or OGG.
- [Convert Video](https://life2film.com/tools/video-converter/): MP4, WebM and MOV in any direction, or pull the audio out as WAV.
- [Video Splitter](https://life2film.com/tools/video-splitter/): Cut a long video into Reels or Shorts that start on a shot change instead of every 30 seconds, ranked by picture quality.
- [Scene Detector](https://life2film.com/tools/scene-detector/): Find every cut in a video and get the shot list with thumbnails, timecodes and quality scores.

- The engine as a package: https://life2film.com/engine/
- Site overview for agents: https://life2film.com/llms.txt
- Every tool page is available as markdown by appending `.md` to its address, or by requesting it
  with `Accept: text/markdown`.

---
Life2Film — on-device video montage. https://life2film.com/
