1
sox audio.wav -n spectrum

Makes picture - not suitable for further automatic processing

I want something like this:

$ cat audio.wav | calculate_spectrum - 
0.2
0.5
0.3
4.6
0.2
5.3
...

Output should be easily consumable by other text-oriented command line tools.

0

Looks like it is SoX's other mode:

sox audio.wav -n stat -freq
0.000000  3.747641
1.953125  4.574969
3.906250  4.452487
5.859375  3.809817
7.812500  3.400568
...
292.968750  8887.592773
294.921875  9049.043945
296.875000  26993.902344
298.828125  134480.718750
300.781250  275895.437500
302.734375  14540.191406
304.687500  7592.689453
...
Rough   frequency:          299

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.