wavesurfer.js
wavesurfer.js copied to clipboard
MP2 files won't render or play
Wavesurfer.js version(s):
5.2.0
Browser and operating system version(s):
Chrome, Firefox, Windows 10, Ubuntu 20.04
Code needed to reproduce the issue:
https://codepen.io/guilhermeb-ciandt/pen/bGYNdoO
Use behaviour needed to reproduce the issue:
Get a MP3 file and convert to MP2, wavesurfer won't be able to reproduce it. On the codepen example I got the MP3 file used on wavesurfer docs example and converted to MP2 using audacity(I also tested using ffmpeg) and that MP2 won't load.
If you want to test from another audio from scratch that's the command I use with ffmpeg:
ffmpeg -y -v error -i {file-path} -f WAV -acodec mp2 -ar 44100 {output_path}
Any error messages?
No error messages
that MP2 won't load.
App just hangs and waits forever? Not a single error message?
You can check the codepen I provided https://codepen.io/guilhermeb-ciandt/pen/bGYNdoO
But yeah, no error message, no waveform drawn, and play simply son't play.
You can add
wavesurfer.on('error', function (err) {
console.warn("error", err?.message || err);
});
to see the error message. I'm not sure any browser can natively decode this type of file (mpeg layer 2). Not a Wavesurfer bug.