Wavesurfer.js: When providing preloaded peaks with MediaElement, the peaks are overwritten once the track loads entirely

Created on 24 Jun 2017  路  5Comments  路  Source: katspaugh/wavesurfer.js

I'm using wavesurfer.js 2.0.0-beta01, MediaElement as a backend, and providing preloaded peaks.

When the track starts playing, the provided peaks are shown OK. But after the whole track gets downloaded, peaks generated by wavesurfer.js are shown over preloaded peaks.

I replicated the issue here: https://codepen.io/newjurgen/pen/KqvYxO (the track is around 20MBs, it can take a little while to load).

How can I prevent this behaviour?

Thanks for making wavesurfer.js.

bug

All 5 comments

Seems it only happens with MediaElement. But I need this backend option because it enables partial content loading..

I solved the issue by adding a parameter when initializing: forceDecode: false. I thought this parameter defaults to false? Looking at this code, it truly looks so: https://github.com/katspaugh/wavesurfer.js/blob/master/src/wavesurfer.js. But somehow the forceDecode gets the value true, even when leaving it out when initializing. Not sure how this happens, looks like a bug.

@entonbiba any idea?

@thijstriemstra it's actually set to true in version 2 by default. pr #1159 to set default to false

image

Fixed by the above PR once it's released.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SGDAT picture SGDAT  路  3Comments

gitdisrupt picture gitdisrupt  路  6Comments

thijstriemstra picture thijstriemstra  路  5Comments

frumbert picture frumbert  路  4Comments

asdfang picture asdfang  路  4Comments