/** * Detect loop points in an audio buffer. * * @param {AudioBuffer|Object} buffer - AudioBuffer or shim exposing * { getChannelData(i), sampleRate, length, duration } * @param {Object} [options] * @param {'fast'|'precise'|'musical'|'recurrence'} [options.strategy='fast'] * @param {number} [options.bpm] - tempo hint for 'precise'/'musical' * (detected via beat tracking when omitted) * @param {number} [options.minLoopDuration] - 'precise': minimum loop length * in seconds * @param {number} [options.maxLoopDuration] - 'precise': maximum loop length * in seconds * @param {number} [options.searchStart] - 'precise': seconds to skip at the * head of the material before searching * @param {number} [options.searchEnd] - 'precise': fraction (0..1) of the * material to search * @param {number} [options.hopLength=512] - 'recurrence': chroma hop length * @param {number} [options.maxFrames=1500] - 'recurrence': frame cap * (matrix cost is frames²) * @param {number} [options.minConfidence=0.1] - 'recurrence': quality gate * (audio-validated NCC) * @param {boolean} [options.rqa=false] - 'recurrence': add an * RQA-path-derived candidate * @param {boolean} [options.snapToZero=true] - 'recurrence': trim boundaries * to zero crossings * @returns {Promise} { * strategy, loopStart, loopEnd, loopStartSample, loopEndSample, * confidence (0..1), bpm?, details } * @throws {Error} on invalid input, unknown strategy, or a failed quality * gate (diagnostic message names the gate and suggests alternatives) */ export function detect(buffer: AudioBuffer | any, options?: { strategy?: "fast" | "precise" | "musical" | "recurrence"; bpm?: number; minLoopDuration?: number; maxLoopDuration?: number; searchStart?: number; searchEnd?: number; hopLength?: number; maxFrames?: number; minConfidence?: number; rqa?: boolean; snapToZero?: boolean; }): Promise; export const STRATEGIES: string[];