1/** 2 * The 3-band waveform, off the main thread: four minutes of audio take 3 * about half a second to filter, which on the main thread would stall the 4 * platters while a track loads. 5 */ 6 7import { computeBandWaveform } from "./bandWaveform"; 8 9self.onmessage = ({ data }) => { 10 const { id, channels, sampleRate } = data; 11 try { 12 const w = computeBandWaveform(channels, sampleRate); 13 self.postMessage({ id, result: w }, [w.low.buffer, w.mid.buffer, w.high.buffer]); 14 } catch (err) { 15 self.postMessage({ id, error: String(err?.message || err) }); 16 } 17};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.