You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Once the wave file is loaded and the redrawcomplete event is triggered, I call exportPeaks and receive and error generated inside wavesurfer.js. The wav file duration is 82 seconds. It plays as expected.
Environment
Browser: Chrome
Minimal code snippet
import WaveSurfer from 'https://cdn.jsdelivr.net/npm/wavesurfer.js@7/dist/wavesurfer.esm.js'
var wavesurfer = WaveSurfer.create({
container: $(div)[0],
waveColor: '#FFF',
progressColor: '#443e3c',
height: 60,
/** Stretch the waveform to the full height */
normalize: true,
/** The cursor width */
cursorWidth: 1,
barWidth: 1,
barRadius: 3,
fillParent: true,
interact: true,
dragToSeek: true,
url: compUrl,
});
wavesurfer.on('redrawcomplete', processWaveReadyEvent);
const peaks = wavesurfer.exportPeaks({
channels: 2, // how many audio channels to export, defaults to 1
maxLength: 30000, // how many peaks per channel
precision: 1e3, // round to 3 digits after comma
});
Expected result
I would receive a valid array of peaks.
Obtained result
Uncaught (in promise) RangeError: Invalid array length
at u (wavesurfer.esm.js:1:13712)
at h.renderMultiCanvas (wavesurfer.esm.js:1:13967)
at h.renderChannel (wavesurfer.esm.js:1:14957)
at h. (wavesurfer.esm.js:1:16209)
at Generator.next ()
at wavesurfer.esm.js:1:283
at new Promise ()
at t (wavesurfer.esm.js:1:28)
at h.render (wavesurfer.esm.js:1:15005)
at u. (wavesurfer.esm.js:1:26674)
Screenshots
The text was updated successfully, but these errors were encountered:
I jacked up the maxLength to 60000 and got the large file through the process. So the question: if maxLength is supposed to limit how much data is generated in the peak array returned, why does it throw an error if the number of peaks exceeds the maxLength?
Bug description
Once the wave file is loaded and the redrawcomplete event is triggered, I call exportPeaks and receive and error generated inside wavesurfer.js. The wav file duration is 82 seconds. It plays as expected.
Environment
Minimal code snippet
Expected result
I would receive a valid array of peaks.
Obtained result
Uncaught (in promise) RangeError: Invalid array length
at u (wavesurfer.esm.js:1:13712)
at h.renderMultiCanvas (wavesurfer.esm.js:1:13967)
at h.renderChannel (wavesurfer.esm.js:1:14957)
at h. (wavesurfer.esm.js:1:16209)
at Generator.next ()
at wavesurfer.esm.js:1:283
at new Promise ()
at t (wavesurfer.esm.js:1:28)
at h.render (wavesurfer.esm.js:1:15005)
at u. (wavesurfer.esm.js:1:26674)
Screenshots
The text was updated successfully, but these errors were encountered: