Skip to content

fastBPMDetect

fastBPMDetect(audioData, sampleRate): object

Defined in: packages/pleco-xa/src/scripts/xa-beat.js:247

Optimized BPM detection - replacement for the slow one Uses onset detection + tempo estimation

Failure paths THROW with diagnostics naming the failed stage — there is no silent fallback estimator here. (The old catch-all fell back to an RMS-interval heuristic that clamped into [60, 200] BPM and reported a fabricated confidence of 0.5; that path was deleted, 2026-07-04.)

any

any

object

beats: number[] = beatResult.beats

bpm: number = beatResult.tempo

confidence: number = beatResult.confidence

onsetStrength: Float32Array<any> = beatResult.onsetStrength

when the beat-tracking stage fails; the original error is attached as cause.