bbc / audiowaveform

C++ program to generate waveform data and render waveform images from audio files
https://waveform.prototyping.bbc.co.uk
GNU General Public License v3.0
1.94k stars 242 forks source link

Hello #164

Closed ytmsuhsff closed 1 year ago

ytmsuhsff commented 2 years ago

Hello, I installed wavesurfer JS audio wave display, but the wave loading speed is very slow. You need to save the wave to the database to load the wave quickly. Is it possible to solve this problem. (wavesurfer.js https://wavesurfer-js.org/ )

Just like them https://icons8.com/music/search/beach https://tunetank.com/tracks/

This is my website http://www.partymusic.cn/

我的邮件 304955091@qq.com

ytmsuhsff commented 2 years ago

Hello, how to use this plug-in? Can you help me, because I'm not a professional

chrisn commented 2 years ago

Thanks for your question. I can see your website takes a long time to load. This is because it's downloading all the MP3 audio files.

I'm not familiar with wavesurfer, but it may be possible to pre-calculate the waveform files on your web server, which avoids the need to download the full MP3 files.

You could possibly use audiowaveform to generate JSON or binary (.dat) format waveform files, host these files on your webserver, and then use this to show the waveform in the web page. Because the JSON or binary waveform files are much smaller than the MP3 files, your page should then be faster to load.

This is how we recommend people use our Peaks.js library (which is similar to wavesurfer) - see our documentation here.

ytmsuhsff commented 2 years ago

I just think the same as you, because I'm not a professional and don't know much about this. I can send you the website program. Can you help me solve it? I can also pay if necessary

chrisn commented 2 years ago

To use audiowaveform, you'll need to install it on your server, there are some details here.

There is information on how to use audiowaveform with wavesurfer here. You'll need to run audiowaveform on each MP3 file to produce a JSON file, then serve the JSON files from your website.

Then, in your JavaScript code, instead of passing the URL of the MP3 file to wavesurver.load(), you pass the URL of the waveform JSON file. It appears that you can use the normalize: true option in WaveSurfer.create() to use JSON files from audiowaveform.

ytmsuhsff commented 2 years ago

I have this template https://zoomthe.me/soundportal/explore After it uploads MP3, it can generate waves by itself How does it do it ,It does not need to be installed on the server After this template is installed, you can generate waves as long as you upload MP3, and then save them to the database,Opening it again is very fast

ytmsuhsff commented 2 years ago

Is there any way to do the same as it

jmcoder1 commented 2 years ago

Is there any way to do the same as it

Did you figure out how to use audiowaveform in your JS code ?

chrisn commented 1 year ago

I'll close this, but please re-open or raise a new issue if you still need help.