Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
calculatePeaks(samplesPerPixel, sampleRate) {
const cueIn = secondsToSamples(this.cueIn, sampleRate);
const cueOut = secondsToSamples(this.cueOut, sampleRate);
this.setPeaks(extractPeaks(this.buffer, samplesPerPixel, this.peakData.mono, cueIn, cueOut));
}
onmessage = function(e) {
let peaks = extractPeaks(e.data.samples, e.data.samplesPerPixel);
postMessage(peaks);
}