Skip to content

Draw waveform without decoding / loading data #4081

Answered by katspaugh
NoyaD9 asked this question in Q&A
Discussion options

You must be logged in to vote

To do this you need to call load with 3 parameters:

wavesurfer.load(audioUrl, peaksData.peaks, peaksData.duration)

If duration isn't passed, it will still load the audio into an <audio> element (but not fetch it with Ajax). The audio URL can be an empty string, but then make sure to pass a duration. You can later call load again with the actual audio URL.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by NoyaD9
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants