Friday, December 31, 2010

How to Extract metadata from audio files via command line using Perl ?

$ cat test.pl  
use MP3::Tag; 
# set filename of MP3 track 
my $filename = "test.mp3"; 
# create new MP3-Tag object 
my $mp3 = MP3::Tag->new($filename); 
# get tag information 
my ($title, $track, $artist, $album, $comment, $year, $genre) = $mp3->autoinfo(); 
print "$title, $track, $artist, $album, $comment, $year, $genre\n";  

$ perl test.pl 

Nakka Mukka, 6/9, Chinnaponnu & Nakulan, Kadhalil Vizhundhen, Digitised by Guru Ashok, 2008, Tamil  

No comments:

Post a Comment