Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

realtime-bpm-analyzer

dlepaux5kApache-2.05.0.0TypeScript support: included

This dependency free library can analyze the BPM (Tempo) of an audio/video node or any stream in realtime on your browser

webaudioapi, audiobuffer, audio, stream, microphone, realtime, no-dependency, tempo, bpm, beats, analyzer

readme

Realtime BPM Analyzer

XO code style npm npm CI Actions Status codecov

Realtime BPM Analyzer

A powerful TypeScript library for detecting beats-per-minute (BPM) in real-time.

📚 Documentation🎯 Examples🚀 Quick Start


Features

  • Zero dependencies - Uses native Web Audio API
  • Real-time analysis - Analyze audio/video as it plays
  • Multiple sources - Works with files, streams, microphone, or any audio node
  • Typed events - Full TypeScript support with autocomplete
  • Client-side only - 100% privacy-focused, no data collection
  • Supports MP3, FLAC, WAV formats

Installation

npm install realtime-bpm-analyzer

Quick Example

import { createRealtimeBpmAnalyzer } from 'realtime-bpm-analyzer';

// Create analyzer
const analyzer = await createRealtimeBpmAnalyzer(audioContext);

// Connect your audio source
audioSource.connect(analyzer.node);

// Listen for BPM detection
analyzer.on('bpm', (data) => {
  console.log('BPM detected:', data.bpm[0].tempo);
});

Documentation

📖 Full Documentation - Complete guides, API reference, and tutorials

Key sections:

Use Cases

  • Audio Players - Display BPM while playing tracks
  • Live Streams - Continuous BPM detection from radio/streaming
  • File Analysis - Offline BPM detection from uploaded files
  • Microphone Input - Real-time analysis from live audio
  • DJ Applications - Beat matching and tempo detection

Running Examples Locally

# Install dependencies
npm install

# Run a specific example
npm run dev --workspace=examples/01-vanilla-basic

# Available examples:
# - 01-vanilla-basic, 02-vanilla-streaming, 03-vanilla-microphone
# - 04-react-basic, 05-react-streaming, 06-react-microphone  
# - 07-vue-basic, 08-vue-streaming, 09-vue-microphone

Privacy & Security

  • 100% client-side processing
  • No data collection or transmission
  • No audio recording - real-time analysis only
  • Open source - fully auditable code

See privacy.md and security.md for details.

Contributing

Contributions are welcome! See contributing.md for guidelines.

License

Apache-2.0 License - See licence.md for details.

For commercial licensing inquiries, contact: d.lepaux@gmail.com

Credits

Inspired by Tornqvist's bpm-detective and Joe Sullivan's algorithm.

changelog

5.0.0 (2025-11-22)

  • feat!: replace documentation generation with improvements BREAKING CHANGE: change api with event emitter (791fb1e)

Bug Fixes

BREAKING CHANGES

  • change api with event emitter

Changelog

All notable changes to this project will be documented in this file.

This changelog is automatically generated by semantic-release based on Conventional Commits.


4.0.2 (2024-03-30)

4.0.1 (2024-03-30)

Bug Fixes

  • add bash interpreter to script (3e78924)
  • replace static skipForwardIndexes to dynamic computation based on sampleRate (9c478b1)

4.0.0 (2024-02-06)

Features

  • testing-tools: add testing tools to challenge bpm accuracy (1899296)
  • testing-tools: cleanup logs (6ff5615)

3.3.0 (2024-01-28)

Features

  • datasets: add manifest generator for datasets (dc927c5)

3.2.1 (2023-06-24)

Bug Fixes

3.2.0 (2023-04-03)

3.1.5 (2023-04-01)

Bug Fixes

3.1.4 (2023-04-01)

3.1.3 (2023-03-21)

3.1.2 (2023-02-12)

3.1.1 (2023-02-11)

3.1.0 (2023-02-11)

3.0.5 (2023-02-02)

3.0.4 (2023-02-02)

3.0.3 (2023-01-29)

3.0.4 (2023-01-29)

3.0.3 (2023-01-29)

3.0.2 (2023-01-28)

3.0.1 (2023-01-27)

Features

  • offline-analyzer: add offline analyzer, this enable the possibility to detect bpm with a browser (event offline) (f921ad2)

3.0.0 (2022-12-01)

3.0.0-10 (2022-11-30)

3.0.0-9 (2022-11-30)

3.0.0-8 (2022-11-30)

3.0.0-7 (2022-11-30)

3.0.0-6 (2022-11-30)

3.0.0-5 (2022-11-30)

3.0.0-4 (2022-11-30)

3.0.0-3 (2022-11-30)

3.0.0-2 (2022-11-30)

3.0.0-1 (2022-11-30)

3.0.0-0 (2022-11-30)

Bug Fixes

2.1.6 (2021-11-28)

Bug Fixes

  • use directly src files for package (884f22f)

2.1.5 (2021-11-28)

2.1.4 (2021-11-28)

2.1.3 (2021-11-28)

Bug Fixes

2.1.2 (2021-11-16)

Bug Fixes

2.1.1 (2021-11-16)

Bug Fixes

2.1.0 (2021-11-16)

Features

  • add audio visualization to each example (06c4f60)
  • add frequency bar graph to see microphone input (523fff1)

Bug Fixes

  • publicPath for github pages (0231494)
  • publicPath for github pages (d7a235c)
  • publicPath for github pages (c6a273d)
  • stop using microphone properly (c4d8585)

2.0.5 (2021-10-19)

2.0.4 (2021-10-18)

2.0.3 (2021-10-17)

2.0.2 (2021-10-17)

Bug Fixes

2.0.1 (2021-10-17)

Bug Fixes

2.0.0 (2021-10-17)

Bug Fixes

1.0.5

  • Fix bugs
  • Optimisations

1.0.0

  • Analyze in realtime BPM/Tempo on audio/video node