Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

check duration of audio files on the command-line

Tags:

unix

audio

sox

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 amazing SoX app which has an option called stats that generates a set of audio info including duration. I am looking for a way to get only duration. I am flexible on output format, could be any of sample length, hh:mm:ss, or seconds. The latter would be my preference.

like image 376
ted.strauss Avatar asked Jan 19 '12 20:01

ted.strauss


People also ask

How do I find out how long an audio file is?

The easiest way to obtain the duration of an audio file is through the embed Audio tag, used to embed sound content in documents. It may contain one or more audio sources, represented using the src attribute or the <source> element nested on the audio tag.

How do I identify an audio file?

Shazam: A mobile app where you can run an audio search by audio instead of text. In other words, you can feed the app a sound and have it determine the title and more information like the artist and possibly lyrics, great for when you need to identify an unknown song.


1 Answers

soxi -D filename soxi -D * 

Soxi queries metadata of audio files; D is the duration option. It supports globbing. Soxi's big brother sox does command-line audio processing.

like image 86
ted.strauss Avatar answered Oct 14 '22 03:10

ted.strauss