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.
Parameters
Section titled “Parameters”audioData
Section titled “audioData”Float32Array<ArrayBufferLike>
sampleRate
Section titled “sampleRate”number
number
BPM used for the musical-length bonus
options?
Section titled “options?”maxLoopDuration?
Section titled “maxLoopDuration?”number = 8.0
Maximum loop length in seconds
minLoopDuration?
Section titled “minLoopDuration?”number = 2.0
Minimum loop length in seconds
searchEnd?
Section titled “searchEnd?”number = 0.8
Search up to this fraction of the track
searchStart?
Section titled “searchStart?”number = 1.0
Start searching after this many seconds
Returns
Section titled “Returns”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)