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.)
Parameters
Section titled “Parameters”audioData
Section titled “audioData”any
sampleRate
Section titled “sampleRate”any
Returns
Section titled “Returns”object
beats:
number[] =beatResult.beats
bpm:
number=beatResult.tempo
confidence
Section titled “confidence”confidence:
number=beatResult.confidence
onsetStrength
Section titled “onsetStrength”onsetStrength:
Float32Array<any> =beatResult.onsetStrength
Throws
Section titled “Throws”when the beat-tracking stage fails; the original error is
attached as cause.