Something went wrong. Try again.
A decentralized music tracking and discovery platform built on AT Protocol 🎵 rocksky.app
spotify atproto lastfm musicbrainz scrobbling listenbrainz
Something went wrong. Try again.
1234567891011/** Pool energy, not maxima: one loud transient must not fill a whole UI bar. */export function waveformLevels(peaks: readonly number[] | null, count: number): number[] { return Array.from({ length: count }, (_, i) => { if (!peaks?.length) return 0; const start = Math.floor(i * peaks.length / count); const end = Math.max(start + 1, Math.floor((i + 1) * peaks.length / count)); const values = peaks.slice(start, end); return Math.sqrt(values.reduce((sum, value) => sum + value * value, 0) / values.length); });}