API Reference / BpmAnalyzerEventMap
Type Alias: BpmAnalyzerEventMap
ts
type BpmAnalyzerEventMap = {
bpm: BpmCandidates;
bpmStable: BpmCandidates;
analyzerReset: void;
analyzeChunk: Float32Array;
validPeak: {
threshold: Threshold;
index: number;
};
error: {
message: string;
error: Error;
};
};Defined in: core/types.ts:31
Type-safe event listener map for BPM analyzer events
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
bpm | BpmCandidates | Emitted continuously during BPM analysis with current tempo candidates | core/types.ts:33 |
bpmStable | BpmCandidates | Emitted when BPM detection has stabilized with high confidence | core/types.ts:35 |
analyzerReset | void | Emitted when the analyzer state has been reset | core/types.ts:37 |
analyzeChunk | Float32Array | Emitted in debug mode when analyzing audio chunks | core/types.ts:39 |
validPeak | { threshold: Threshold; index: number; } | Emitted in debug mode when a valid peak is detected | core/types.ts:41 |
validPeak.threshold | Threshold | - | core/types.ts:41 |
validPeak.index | number | - | core/types.ts:41 |
error | { message: string; error: Error; } | Emitted when an error occurs during processing. Remarks Worklet-load failures thrown by createRealtimeBpmAnalyzer wrap the underlying cause via Error.cause (ES2022). Inspect error.cause to read the originating DOMException. Example analyzer.on('error', ({error}) => { console.log(error.message); console.log((error as Error).cause); }); | core/types.ts:56 |
error.message | string | - | core/types.ts:56 |
error.error | Error | - | core/types.ts:56 |