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.

How to load only waveform and wait to user click 'play' to download the audio?

See original GitHub issue

i am already using a array format to display the waveform first in .load(audio_url,[array of floats]), but in the page has a lot instances to diferent audio files and this slow the page because has to download a lot of audio files.So how can i load the the canvas with the waveform and when i press play to certain wavesurfer instance then download the audio file?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
katspaughcommented, Aug 13, 2016

In your codepen you had triple quotes around the audio src. I’ve fixed it for you: http://codepen.io/katspaugh/pen/oLmwoZ

1reaction
katspaughcommented, Aug 12, 2016

@drhouse7 I see you are using MediaElement. Maybe try passing an audio element you create yourself in HTML with preload="false", like this:

<audio id="song" style="display: none" preload="false" src="'http://api.soundcloud.com/tracks/45398925..."></audio>

And then pass this audio element instead of the URL:

wavesurfer.load(document.querySelector('#song'), [ 0.0218, 0.0183, 0.0165, 0.0198, 0.2137, ... ]);

Also try experimenting with setting the src of the audio element after the user presses play. It might or might not work, I haven’t checked.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I load only waveform and wait to user click 'play' to ...
On frontend I use Wavesurfer-JS to draw the waveform based on previous JSON data. The problem is that on page ready the Wavesurfer-JS...
Read more >
jQuery : How can I load only waveform and wait to user click ...
jQuery : How can I load only waveform and wait to user click 'play' to download the audio on Wavesurfer-js?
Read more >
Javascript – How to load only waveform and wait to user click 'play ...
The problem is that on page ready the Wavesurfer-JS download on background the audio file all the time (and not only when the...
Read more >
Loading and Playing Sound Files
Loading and Playing Sound Files. Method 1: Raw HTML. The easiest way to load and play a sound file does not actually require...
Read more >
Add an audio file to the Playback plug-in in MainStage
You can preview an audio file in the Open dialog by selecting the file and clicking Play. To hear the file after adding...
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