Moode Forum
[IDEA] waveform visualisation in web player ? - Printable Version

+- Moode Forum (https://moodeaudio.org/forum)
+-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3)
+--- Forum: Feature requests (https://moodeaudio.org/forum/forumdisplay.php?fid=8)
+--- Thread: [IDEA] waveform visualisation in web player ? (/showthread.php?tid=6049)

Pages: 1 2


waveform visualisation in web player ? - jeryci - 12-20-2023

Hi all,
i cannot find this requested, although i think this could be popular, 
any chance we could get a visual representation of the waveform of the audio playing ?
some other players provide this like roon [attachment=3510] or plexamp [attachment=3511]

maybe i missed something but to me that would be a great addition, as this allows to see what is coming in the track and allows to position precisely in the track when needed.
thanks for this great project and your input Wink

Jeryci


RE: waveform visualisation in web player ? - Tim Curtis - 12-20-2023

You might want to inspect the element on the Webpage and see if you can determine what code is being used to render the waveform.

If they are using an already developed Open Source project on GitHub for this code, I'll have a look at it.


RE: waveform visualisation in web player ? - Nutul - 12-20-2023

(12-20-2023, 03:48 PM)Tim Curtis Wrote: You might want to inspect the element on the Webpage and see if you can determine what code is being used to render the waveform.

If  they are using an already developed Open Source project on GitHub for this code, I'll have a look at it.

I think those are images generated on the server side, as you need to examine the whole track to be able to draw the thing.


RE: waveform visualisation in web player ? - steve4star - 12-22-2023

I was able to generate the following image from a flac file:-
[attachment=3517] 
using
Code:
ffmpeg -i 04.\ 22\ Acacia\ Avenue.flac -f lavfi -i color=c=black:s=640x320 -filter_complex   "[0:a]showwavespic=s=640x320:colors=white[fg];[1:v][fg]overlay=format=auto" -y  -frames:v 1 /tmp/out.png 2>/dev/null

with guidance from the ffmpeg WIKI


RE: waveform visualisation in web player ? - TheOldPresbyope - 12-22-2023

Nice but just renders a static image. 

I inferred from the images you the OP posted previously that you they wanted a time-dependent display showing progress along the image instead of---or in addition to---showing elapsed time digitally. That would take more coding-fu. Smile

Regards,
Kent


RE: waveform visualisation in web player ? - steve4star - 12-22-2023

Quote:I inferred from the images you posted previously that you wanted a time-dependent display showing progress along the image instead of---or in addition to---showing elapsed time digitally. That would take more coding-fu. [Image: smile.png]
Yes that was my inference too.
It would probably need semi transparent overlay that was sized according to the time elapsed to show progress.
Also, someone who can code better than me.


RE: waveform visualisation in web player ? - Tim Curtis - 12-22-2023

One of the challenges with this is the time it takes to generate each tracks waveform is dependent on the the length of the track. Some users have a lot of whole CD FLAC/CUE or DSD files.

It doesn't seem like something that can be done in real-time before the track starts playback.


RE: waveform visualisation in web player ? - steve4star - 12-22-2023

(12-22-2023, 04:45 PM)Tim Curtis Wrote: One of the challenges with this is the time it takes to generate each tracks waveform is dependent on the the length of the track. Some users have a lot of whole CD FLAC/CUE or DSD files.

It doesn't seem like something that can be done in real-time before the track starts playback.

Agreed, all my tracks are single files but cue files would be a challenge.
Could the queue processor look ahead ? 

Could it be an extra option on the thumbnail generator?
Would add a considerable amount of time/processing though.


RE: waveform visualisation in web player ? - Tim Curtis - 12-22-2023

Your best bet is to try to find out how these other apps do track waveforms, even better to link to some code.


RE: waveform visualisation in web player ? - TheOldPresbyope - 12-22-2023

True that. I was thinking it could be done while scanning a Library---course that's a whole 'nother problem, building a thumbnail-like directory.

Just for fun, I tried @steve4star 's command on several modestly sized tracks---one FLAC, one M4A, and one DSD. On an RPI4B it took from 2 to 6 seconds to execute, so a noticeable delay if at start of play.

Regards,
Kent