Fourier transform audio files? I need to batch-process some (several hours of) audio files and get their frequency/amplitude data.

I really have 10 folders each containing many wav files and I need the averages of each folder. I need to get the levels of different frequencies across each folder, and computing the levels individually for each file then averaging would work, and if you know of another method please suggest it.

Is there a command-line tool (or other resource) that will compute these Fourier transforms for me?
SoX can do this:

play file.wav stat -freq


It will output  something like this:

file.wav:

 File Size: 191k      Bit Rate: 256k
  Encoding: Signed PCM
  Channels: 1 @ 16-bit
Samplerate: 16000Hz
Replaygain: off
  Duration: 00:00:05.98

In:0.00% 00:00:00.00 [00:00:05.98] Out:0     [      |      ]        Clip:0    0.000000  0.005858
3.906250  0.006152
7.812500  0.006272
11.718750  0.006785
15.625000  0.004786
...
In:17.1% 00:00:01.02 [00:00:04.95] Out:43.0k [    -=|=-    ]        Clip:0    0.000000  0.057157
3.906250  0.004143
7.812500  1.779299
11.718750  0.120536
15.625000  0.062992
19.531250  0.059568
23.437500  0.149960
...
In:100%  00:00:05.98 [00:00:00.00] Out:264k  [      |      ]    

    Clip:0
Samples read:             95616
Length (seconds):      5.976000
Scaled by:         2147483647.0
Maximum amplitude:     0.440094
Minimum amplitude:    -0.298309
Midline amplitude:     0.070892
Mean    norm:          0.041338
Mean    amplitude:     0.000022
RMS     amplitude:     0.064054
Maximum delta:         0.529938
Minimum delta:         0.000000
Mean    delta:         0.011127
RMS     delta:         0.025654
Rough   frequency:         1019
Volume adjustment:        2.272
Done.


The ... are omitted lines, of which there are many (thousands).

These sections:

3.906250  0.006152
7.812500  0.006272
11.718750  0.006785
15.625000  0.004786


Are a table of Frequency against Level.