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





A powerful TypeScript library for detecting beats-per-minute (BPM) in real-time.
📚 Documentation •
🎯 Examples •
🚀 Quick Start
---
- 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
``bash`
npm install realtime-bpm-analyzer
`typescript
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);
});
`
📖 Full Documentation - Complete guides, API reference, and tutorials
Key sections:
- Quick Start Guide - Get up and running
- API Reference - Complete API documentation
- Examples - Live demos and code samples
- Migration to v5 - Upgrading from v4.x
- 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
`bashInstall dependencies
npm install
- 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.
Contributions are welcome! See contributing.md for guidelines.
Apache-2.0 License - See licence.md for details.
For commercial licensing inquiries, contact: d.lepaux@gmail.com
Inspired by Tornqvist's bpm-detective and Joe Sullivan's algorithm.