check duration of audio files on the command-line

后端 未结 14 866
攒了一身酷
攒了一身酷 2021-02-05 00:00

I need to check the duration of a group of audio files. Is there a simple way to do this on the unix command-line?

> duration *

I have the a

14条回答
  •  野性不改
    2021-02-05 00:36

    If you are interested in finding total duration of wav files in a directory using soxi you can use this:

    soxi -D input_dir/*.wav | python -c "import sys;print(sum(float(l) for l in sys.stdin))

    change input_dir according to your input directory. If you want to find max/min duration between all wav files feel free to change sum to max or min.

提交回复
热议问题