Re: [LAU] Audio File to Graphic Thumbnail in Command Line?

From: Kevin Cosgrove <kevinc@email-addr-hidden>
Date: Wed Sep 03 2014 - 02:12:29 EEST

I dug into this a bit more.

Getting the time & amplitude data out of the WAV file was easy with

  sox file.wav -t dat - | tail -n +3 > file.dat

My beloved xgraph is not available on Fedora anymore. That made me
relearn gnuplot, a good move regardless. I wrote a script to build
a gnuplot input file, file.gpl, which contains something like

  set terminal png notransparent nocrop
  set output file.png
  plot [] [-1:1] "file.dat" with lines

Then I run gnuplot on its input file like so

  gnuplot file.gpl > file.png

I left out a lot of housekeeping related to my scripting. But, the
above does all of the work needed to produce a nice graph of my audio
files.

Of course, this isn't fast. It takes about 4 minutes on my
3.4GHz i7 with 16GB of RAM to create a plot from a 0.5GB mono WAV
file. Audacity and Ardour are faster than sox + gnuplot at creating
their waveform views. But, I can script with sox + gnuplot.

I hope this is useful for someone trolling the archive someday.

Cheerio...

--
Kevin
_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-user
Received on Wed Sep 3 04:15:05 2014

This archive was generated by hypermail 2.1.8 : Wed Sep 03 2014 - 04:15:05 EEST