wavesurfer.js icon indicating copy to clipboard operation
wavesurfer.js copied to clipboard

MP2 files won't render or play

Open guilhermeb-ciandt opened this issue 3 years ago • 5 comments
trafficstars

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}

guilhermeb-ciandt avatar Jan 26 '22 14:01 guilhermeb-ciandt

Any error messages?

thijstriemstra avatar Feb 07 '22 16:02 thijstriemstra

No error messages

guilhermeb-ciandt avatar Feb 07 '22 20:02 guilhermeb-ciandt

that MP2 won't load.

App just hangs and waits forever? Not a single error message?

thijstriemstra avatar Feb 08 '22 22:02 thijstriemstra

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.

guilhermeb-ciandt avatar Feb 11 '22 16:02 guilhermeb-ciandt

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.

marcelblum avatar Feb 16 '22 21:02 marcelblum