Get MP3 file info quickly via the Terminal

Oct 19, 2010 - 3 Comments

The fastest way I know of to get MP3 file info out of Mac OS X is using the Terminal. The command you’ll want to use is called afinfo, launch the Terminal and type this at the command line:
afinfo filename.mp3
A series of information will then be reported back, looking like the following:
File: iTunes/iTunes Music/Empire of the Sun/Empire of the Sun - Girl.mp3
File type ID: MPG3
Data format: 2 ch, 44100 Hz, '.mp3' (0x00000000) 0 bits/channel, 0 bytes/packet, 1152 frames/packet, 0 bytes/frame
no channel layout.
estimated duration: 238.629 sec
audio bytes: 9545142
audio packets: 9135
bit rate: 320000 bits per second
packet size upper bound: 1052
maximum packet size: 1045
audio data file offset: 10302

This command works on with any audio file and is not limited to MP3’s. We have covered afinfo in the past when checking the bitrate of an audio file.

Enjoy this tip? Subscribe to the OSXDaily newsletter to get more of our great Apple tips, tricks, and important news delivered to your inbox! Enter your email address below:

Related articles:

Posted by: David Mendez in Command Line, Mac OS X


» Comments RSS Feed

  1. Paul says:

    I think you meant “afinfo” not “afplay”!

    • Manish says:

      Good catch and you are right, it looks like the author didn’t have his coffee this morning!

      Post has been updated accordingly, thank you.

      – Manish

  2. […] Read this article: Get MP3 file info quickly via the Terminal […]

Leave a Reply


Shop for Apple & Mac Deals on

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates