Skip to content

recurrenceLoopDetection

recurrenceLoopDetection(audioBuffer, options?): Promise<any>

Defined in: packages/pleco-xa/src/scripts/xa-recurrence.js:493

Recurrence loop detection using matrix analysis.

Returns REAL candidates validated against the raw audio, or THROWS a diagnostic error. There are no fabricated fallbacks: every returned confidence is the normalized cross-correlation (0..1) between the candidate loop segment and the audio that follows it.

Cost note: the similarity matrix is O(frames² × features). For long buffers the hop length is scaled up (documented in diagnostics.hopLength) so that frame count stays under maxFrames — a resolution trade within the same algorithm, never a switch to a different strategy.

any

AudioBuffer or shim with getChannelData

number

number

cap on chroma frames (matrix is frames²)

number

quality gate on audio-validated NCC

Promise<any>

{ loopStart, loopEnd, confidence, candidates, diagnostics }