check duration of audio files on the command-line

后端 未结 14 895
攒了一身酷
攒了一身酷 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:53

    (When you don't have afinfo at your disposal) I got it recursively for all my files

    # install mp3info if not yet installed with
    sudo apt-get install mp3info
    

    with the find command, put the total seconds to a csv file (go to the directory with your e.g. mp3 files first)

    find . -name "*.mp3" -exec mp3info {} -p "%S\r\n" >> totalSeconds.csv \;
    

    Then open it in e.g. in LibreOffice and sum it up at the bottom (to get the hours) with

    =SUM(A{start}:A{end})/60/60
    

提交回复
热议问题