Skip to content

detect

detect(buffer, options?): Promise<any>

Defined in: packages/pleco-xa/src/loop/detect.js:65

Detect loop points in an audio buffer.

any

AudioBuffer or shim exposing { getChannelData(i), sampleRate, length, duration }

number

tempo hint for ‘precise’/‘musical’ (detected via beat tracking when omitted)

number

‘recurrence’: chroma hop length

number

‘recurrence’: frame cap (matrix cost is frames²)

number

‘precise’: maximum loop length in seconds

number

‘recurrence’: quality gate (audio-validated NCC)

number

‘precise’: minimum loop length in seconds

boolean

‘recurrence’: add an RQA-path-derived candidate

number

‘precise’: fraction (0..1) of the material to search

number

‘precise’: seconds to skip at the head of the material before searching

boolean

‘recurrence’: trim boundaries to zero crossings

"fast" | "precise" | "musical" | "recurrence"

Promise<any>

{ strategy, loopStart, loopEnd, loopStartSample, loopEndSample, confidence (0..1), bpm?, details }

on invalid input, unknown strategy, or a failed quality gate (diagnostic message names the gate and suggests alternatives)