exporting spectrum from command line

hi there,
i’m searching for a way to get the analyzed data (menu>analyze>plot spectrum) from command line (linux) or at least without starting audacity for every file i want to analyze.
the goal is to get the description of the tone in a textfile so something like d6, f#7 ect.
i thought about comapring the peaks as they are just doubles in the exported file but i need an automated way to do that.
the instrument i need it for is a kids xylophone with 7 different tones.
i also tried with sox and the output of the stat -freq plugin but this isn’t analyzed at all and i figurede out that the hamming window analysis gives the best results (as the tones i have range from 1100 - 2800 Hz)

does anybody know a way to solve this problem by either getting the max db freq peak or just exporting the analysis from command line
thanks for the help

Audacity is very much a GUI based application. About the only thing that you can do with it from the command line is to open a file. I think you need to be looking for a different program.

thanks, i was searching for something similar,but it’s really hard to find sound analysis tools. i now hacked my own cmdline version from the spectrum analyzer together using audacity code and libsndfile but i am wondering why i get different values as audacity. i think it has something to do with the window size, anybody any idea on that?

edit
maybe i should mention (just that maybe people know the solution from experience: my spectrum sets the peak on 517Hz and the Audacity one sets it correct on 1182 Hz)


for reference:
code (needs FFT.h/ FFT.cpp) from audacity with wx Stuff commented out (just one function anyway)
http://pastebin.com/m451f6ecc

and the two txt’s:

my spectrum analysis:
http://pastebin.com/m5613c89d

and the one from audacity:
http://pastebin.com/m38a46854

also the sound file which i used:
http://rapidshare.com/files/248321793/test.wav.html

Have you had a look at http://www.speech.kth.se/wavesurfer/

Sorry, I can’t help with the code, I’m not a programmer.