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
When exporting peaks using exportPeaks(), if the audio is too loud at any points, it will very occasionally return a value that is larger than 1. This is a bug in and of itself, but the real bug is that when using those calculated peaks to draw the waveform, if there is even a single point larger than 1, the entire drawing will break and not display anything. The canvas is still created, but no waveforms are drawn. The only indicator that the peaks were incorrect was the getDecodedData() function would never return true.
Bug description
When exporting peaks using exportPeaks(), if the audio is too loud at any points, it will very occasionally return a value that is larger than 1. This is a bug in and of itself, but the real bug is that when using those calculated peaks to draw the waveform, if there is even a single point larger than 1, the entire drawing will break and not display anything. The canvas is still created, but no waveforms are drawn. The only indicator that the peaks were incorrect was the getDecodedData() function would never return true.
Environment
Minimal code snippet
<WavesurferPlayer
url={assetUrl}
height={0}
onReady={handleReady}
onError={(error) => {
console.error(
[${assetId}] WaveSurfer onError callback
, error);}}
/>
// handleReady function...
const peaks = instance.exportPeaks({
channels: 1,
maxLength: 1000,
precision: 10000,
});
You can use this file to test it, this produces out of range values most of the time: https://backendstack-infobotpublicmediabucket54fa782c-v7uucaracfsr.s3.us-west-1.amazonaws.com/assets/sounds/music/luxury%20electronic%20pulsating%20deep%20atmospheric.mp3
Expected result
I would expect either an error to be thrown, or a waveform to be drawn with a missing peak where the out of bounds values are
Obtained result
No peaks drawn at all, and no error message.
Screenshots
The text was updated successfully, but these errors were encountered: