question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

After adding peaks to the load parameters, events stop firing

See original GitHub issue

If I just use the wavesurfer.load(url) method, the file is loaded and the events fire without any problems, for example “ready”:

wavessurfer.on('ready', function() {
	wavessurfer.play();
});

If I add peeks as parameters, an image of loaded peeks appears, but not one event is fired anymore:

var peeks = [0.0022365502,0.27022097,0.018188005,-0.289925, ...more values... 0.16755348];
wavesurfer.load(url, peeks);

I am using the latest version of wavessurfer.js: unpkg.com/wavesurfer.js@6.3.0/dist/wavesurfer.js

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
alexey-v-paramonovcommented, Oct 31, 2022

Same problem here. If there is a file URL and peaks data - “ready” event is not fired with “WebAudio” backend (“waveform-ready” if not fired as well). Version 6.3.0. As a temporary workaround I am calling .play() right after the .load() call, catch “ready” event (that is getting fired then) and immediately call .pause() inside my “ready” hook. Then “ready” event is generated properly and I can add regions to my waveform.

0reactions
bobfangcommented, Nov 18, 2022

Same problem here. If there is a file URL and peaks data - “ready” event is not fired with “WebAudio” backend (“waveform-ready” if not fired as well). Version 6.3.0. As a temporary workaround I am calling .play() right after the .load() call, catch “ready” event (that is getting fired then) and immediately call .pause() inside my “ready” hook. Then “ready” event is generated properly and I can add regions to my waveform.

this workaround solves the problem for me. thank you! in my case, i am not supplying the duration of the audio clip when loading (since the audiowaveform json output doesn’t carry this information).

Read more comments on GitHub >

github_iconTop Results From Across the Web

'ready' event only fires when using load() without the peaks ...
Hello,. When using load() without the peak parameter, the READY event is fired as expected. ... However, when loading in peaks from an...
Read more >
Event listener firing too early when parameters are passed
The cancel function requires two parameters which it uses to determine which list of entities to build. The problem lies in the parameters....
Read more >
HPLC troubleshooting guide - CCC
This variability should not be detrimental to your method, since the retention times of all peaks change proportionally to each other and resolution...
Read more >
Welcome to Bull's Guide - GitHub Pages
When a job stalls, depending on the job settings the job can be retried by another idle worker or it can just move...
Read more >
SoundManager 2: Javascript Sound for the Web - Futures and Options
When served over HTTP, internet URLs may be loaded but not local filesystem ... In the event SMSound.onload() fires and the loaded property...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found