Skip to main content

Variable: waveformPresets

const waveformPresets: object;

Defined in: useWaveform.ts:53

Ready-made option sets. They are plain objects: spread one and override whatever you like.

Type Declaration​

chat​

chat: object;

Voice messages and other short clips drawn with a few dozen bars. Analyzes at low resolution (fast, ~12 KB of peaks), uses loudness (RMS) so speech keeps its shape, and ignores the loudest 1% of buckets so a single plosive doesn't flatten the rest.

chat.analysis​

analysis: object;

chat.analysis.maxBuckets​

maxBuckets: number = 1_000;

chat.metric​

metric: "rms" = 'rms';

chat.normalize​

normalize: object;

chat.normalize.percentile​

percentile: number = 0.99;

chat.normalize.scale​

scale: "linear" = 'linear';

editor​

editor: object;

Precise views with deep zoom: full resolution, sample peaks, no clipping.

editor.analysis​

analysis: object;

editor.analysis.maxBuckets​

maxBuckets: number = 100_000;

editor.metric​

metric: "peak" = 'peak';

editor.normalize​

normalize: object;

editor.normalize.percentile​

percentile: number = 1;

editor.normalize.scale​

scale: "linear" = 'linear';

player​

player: object;

Track overviews and scrubbers: moderate resolution, loudness-based.

player.analysis​

analysis: object;

player.analysis.maxBuckets​

maxBuckets: number = 10_000;

player.metric​

metric: "rms" = 'rms';

player.normalize​

normalize: object;

player.normalize.percentile​

percentile: number = 0.995;

player.normalize.scale​

scale: "linear" = 'linear';

Example​

useWaveform(url, { ...waveformPresets.chat, barCount: 40 });