Skip to content

findPreciseLoop

findPreciseLoop(audioData, sampleRate, tempo, options?): any

Defined in: packages/pleco-xa/src/loop/precise.js:36

Find precise loop boundaries by testing actual audio repetition. Much more accurate than bar-aligned approaches.

Float32Array<ArrayBufferLike>

number

number

BPM used for the musical-length bonus

number = 8.0

Maximum loop length in seconds

number = 2.0

Minimum loop length in seconds

number = 0.8

Search up to this fraction of the track

number = 1.0

Start searching after this many seconds

any

best loop { start, end, duration, score, musicalBonus, totalScore } or null when no candidate could be scored (callers must handle null — never invent a result)