wavesurfer.js
wavesurfer.js copied to clipboard
Does wavesurfer work with streaming audio?
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.
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).
@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 , 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 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 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.
@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 in summary i currently forked wavesurfer and removed all pre-download. (sources with acknowledge in my github repo)
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
Only with pre-decoded peaks and duration.
Hi @katspaugh thanks. Ok great - I can provide peaks and duration. Is there any special consideration required for returned headers on the response?
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.