HydrogenAudio

Hydrogenaudio Forum => General Audio => Topic started by: odyssey on 2009-08-18 19:07:46

Title: CLI tool to plot the waveform of an audio file to an image
Post by: odyssey on 2009-08-18 19:07:46
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 (http://209.85.229.132/search?q=cache:xNkmsEoHyzkJ:www.experts-exchange.com/Programming/Multimedia_Programming/Q_24436730.html+wav|sound+draw+waveform|image|png|bmp|gif|jpg&cd=43&hl=da&ct=clnk&gl=dk), 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 (http://www.freesound.org/blog/?p=10) and I have a feeling that it might be the best option, if I'm able to make it run correctly on Windows.

(http://media.freesound.org/files/wav2png/1162_walkerbelm_so_fmperc_w.png)

I feel I've been searching the web around several times with no luck - Anyone know of something better?
Title: CLI tool to plot the waveform of an audio file to an image
Post by: rpp3po on 2009-08-18 19:13:38
Sox can output frequency plots to png images.
Title: CLI tool to plot the waveform of an audio file to an image
Post by: odyssey on 2009-08-18 19:24:49
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 (http://sox.sourceforge.net/sox.html)... 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.
Title: CLI tool to plot the waveform of an audio file to an image
Post by: odyssey on 2009-08-18 20:03:34
Initially my plan with sox was to do something like this (http://linuxwebdev.blogspot.com/2006/03/plot-wav-file-wav2png.html) using gnuplot. However, I'm not sure piping on Windows is as efficient as *nix-systems?
Title: CLI tool to plot the waveform of an audio file to an image
Post by: Axon on 2010-02-25 20:52:23
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.
Title: CLI tool to plot the waveform of an audio file to an image
Post by: menno on 2010-02-25 21:02:39
Avisynth can do that: http://avisynth.org.ru/docs/english/extern.../audiograph.htm (http://avisynth.org.ru/docs/english/externalfilters/audiograph.htm)