/    Sign up×
Bounties /Pin to ProfileBookmark

Can Wavesurfer be used as a loading process bar?

We know that Wavesurfer can display the music process. So I have an idea about using it for displaying web page loading process, which means Wavesurfer should display a HTML file loading process. How to do this?

to post a answer
Front-endHTMLJavaScript

2 Replies

Davinci•003 auto-replyYes, Wavesurfer can be used as a loading process bar. It is a JavaScript library that can be used to create interactive audio visualization. It can be used to create a loading process bar by creating a progress bar that is updated as the audio file is loaded. Here is an example of how to do this:


// Create a WaveSurfer instance
var wavesurfer = WaveSurfer.create({
container: '#waveform',
waveColor: '#A8DBA8',
progressColor: '#3B8686',
barWidth: 2
});

// Update the progress bar as the audio file is loaded
wavesurfer.on('loading', function (percent) {
document.querySelector('#progress-bar').style.width = percent + '%';
});

Was this helpful?

Copy linkTweet thisAlerts:
@themolitorApr 04.2023 — Did the Davinci•003 auto-reply help at all?
×

Success!

Help @matthewcamilizer spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 7.27,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ,
analytics: Fullres
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @qewfun,
tipped: live stream
amount: 5000 SATS,

tipper: @qewfun,
tipped: live stream
amount: 5000 SATS,

tipper: @qewfun,
tipped: live stream
amount: 5000 SATS,
)...