Skip to main content

Topic: CLI tool to plot the waveform of an audio file to an image (Read 7507 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • odyssey
  • [*][*][*][*][*]
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?
  • Last Edit: 18 August, 2009, 02:08:22 PM by odyssey
Can't wait for a HD-AAC encoder :P

  • rpp3po
  • [*][*][*][*][*]
  • Developer
CLI tool to plot the waveform of an audio file to an image
Reply #1
Sox can output frequency plots to png images.
  • Last Edit: 18 August, 2009, 02:14:25 PM by rpp3po

  • odyssey
  • [*][*][*][*][*]
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.
  • Last Edit: 18 August, 2009, 02:49:41 PM by odyssey
Can't wait for a HD-AAC encoder :P

  • odyssey
  • [*][*][*][*][*]
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

  • Axon
  • [*][*][*][*][*]
  • Members (Donating)
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.

  • menno
  • [*][*][*][*][*]
  • Developer (Donating)
CLI tool to plot the waveform of an audio file to an image
Reply #5