Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: CLI tool to plot the waveform of an audio file to an image (Read 9678 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

CLI tool to plot the waveform of an audio file to an image

Does anyone know of a CLI (command line) tool on Windows with the ability to plot the waveform of an audio file to a custom sized image? I'm talking about a visual representation as the one seen in Audition or any other sound editor.

Currently I have tried these PHP scripts, but they are not of very good quality. They produces a weird representation only consisting og a positive OR a negative value (while a zoomed out representation should contain both).

I tried sox that can convert a file to a text-file filled with values, but this is so huge that it's just not an option.

Yet I have to try this wav2png.py script and I have a feeling that it might be the best option, if I'm able to make it run correctly on Windows.



I feel I've been searching the web around several times with no luck - Anyone know of something better?
Can't wait for a HD-AAC encoder :P

CLI tool to plot the waveform of an audio file to an image

Reply #1
Sox can output frequency plots to png images.

CLI tool to plot the waveform of an audio file to an image

Reply #2
Didn't see that in the docs  - How does it do that?? Ah frequency-plot == spectrogram...

Edit: I found out how to make a spectrogram using sox... Which is pretty neat, but not really what I was looking for right now  The docs on it still doesn't seem to explain it. I even tried a search on "PNG" on the entire sox docs site, which only returned this link.
Can't wait for a HD-AAC encoder :P

 

CLI tool to plot the waveform of an audio file to an image

Reply #3
Initially my plan with sox was to do something like this using gnuplot. However, I'm not sure piping on Windows is as efficient as *nix-systems?
Can't wait for a HD-AAC encoder :P

CLI tool to plot the waveform of an audio file to an image

Reply #4
Bump. I have recently come into a need for this sort of thing, but more specifically, a way to animate a waveform so as to have it placed into a video. (No, doing a video cap of the fb2k scope won't work, the framerates won't match.)

I'm thinking hacking wav2png.py is going to make the most sense - ie, create PNGs (or an AVI) of a sliding window of the waveform - but I wanted to know if anybody has already done this sort of thing, before I start reinventing wheels.