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

Does wavesurfer work with streaming audio?

Open wrybread opened this issue 4 years ago • 7 comments

I'm trying to play an Icecast stream. Can wavesurfer.js do that?

If not, can anyone recommend a similar project that does? I don't need much of an interface, just play/pause and volume. I know there's many out there, but so many of them have issues. I love the reliability and flexibility and documentation of wavesurfer.

wrybread avatar May 02 '20 06:05 wrybread

No wavesurfer.js can't do this (out of the box) and I'm not familiar with any plugins or projects that do (and use wavesurfer.js).

thijstriemstra avatar May 13 '20 22:05 thijstriemstra

@wrybread This branch was used to exemplify playing an Icecast Ogg Opus stream after another user asked. It's only a proof-of-concept, and you'll need to mind the memory usage.

anthumchris avatar Jun 03 '20 04:06 anthumchris

@AnthumChris , maybe more simple way to do this is MSE aka (Media Source Extensions) ? That way it connects to existing html5 tag and allow http live streaming chunk buffers passing to internal decoder?

MrdUkk avatar Apr 20 '21 16:04 MrdUkk

@MrdUkk Yes, good idea. During my experiments with MSE, I found latency to be a little high and there wasn't enough control that i was hoping for. but those were only experiments.

anthumchris avatar Apr 20 '21 17:04 anthumchris

@AnthumChris main problem with wavesurfer is its strictly requirements to download entire audio before it will actually work correctly. it was a bit of pain as i see in ISSUES very high number of requests for work without backend. i have this problem too. i have pre-computed waveform peaks and have dynamic mp3 livestream signal without http 206 partial content (and alas without content-length) and all that sh**. precise milliseconds offset and authorization is passed in headers too. so i investigate problem too.

MrdUkk avatar Apr 20 '21 20:04 MrdUkk

@AnthumChris main problem with wavesurfer is its strictly requirements to download entire audio before it will actually work correctly. it was a bit of pain as i see in ISSUES very high number of requests for work without backend. i have this problem too. i have pre-computed waveform peaks and have dynamic mp3 livestream signal without http 206 partial content (and alas without content-length) and all that sh**. precise milliseconds offset and authorization is passed in headers too. so i investigate problem too.

any solution?

nemesisKO avatar Nov 29 '21 10:11 nemesisKO

@nemesisKO in summary i currently forked wavesurfer and removed all pre-download. (sources with acknowledge in my github repo)

MrdUkk avatar Nov 30 '21 07:11 MrdUkk

Hi, does latest version of wavesurfer have support for streaming in order to allow fetching of only partial mp3 files on seek to play only a limited portion of a track? Thanks

tombburnell avatar Oct 27 '23 11:10 tombburnell

Only with pre-decoded peaks and duration.

katspaugh avatar Oct 27 '23 12:10 katspaugh

Hi @katspaugh thanks. Ok great - I can provide peaks and duration. Is there any special consideration required for returned headers on the response?

tombburnell avatar Oct 27 '23 12:10 tombburnell

It's a regular audio element under the hood. So just make sure your server sends the right MIME type and supports time range requests. And of course that the browser can play that file type.

katspaugh avatar Oct 27 '23 12:10 katspaugh