Frequency distribution from wav files

前提是你 提交于 2019-12-11 13:42:52

问题


I found out that I can use SoX's

play file.wav stat -freq

to generate a table of levels against frequencies for a file.

However, it seems to run in real time, i.e. takes as long to complete as the audio does to play.

How can I generate the same table of frequencies and levels but in the shortest time possible?


回答1:


The output of SoX is rather slow, but this is mainly caused by the displaying. One solution could be to redirect the output of SoX (which is on the standard error (stderr) stream in the case of stat) to a file.

You could use:

sox file.wav -n stat -freq > out 2>&1

that will redirect stderr to stdout (&1), and then redirect stdout to the file 'out'. See this link for other solutions to redirect stderr.

This should be rather faster (in my case few seconds for a 10 minute file).



来源:https://stackoverflow.com/questions/47468299/frequency-distribution-from-wav-files

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!