Small Sample Script for MP3::Tag Module :
#!/usr/bin/perl
# use module
use MP3::Tag;
# set filename of MP3 track
$filename = "track1.mp3";
# create new MP3-Tag object
$mp3 = MP3::Tag->new($filename);
# get tag information
$mp3->get_tags();
# check to see if an ID3v1 tag exists
# if it does, print track information
if (exists $mp3->{ID3v1})
{
print "Filename: $filename\n";
print "Artist: " . $mp3->{ID3v1}->artist . "\n";
print "Title: " . $mp3->{ID3v1}->title . "\n";
print "Album: " . $mp3->{ID3v1}->album . "\n";
print "Year: " . $mp3->{ID3v1}->year . "\n";
print "Genre: " . $mp3->{ID3v1}->genre . "\n"; }
# clean up
$mp3->close();
Thisqotdsubmit at this domain> example opens a *m3u playlist and writes a HTML Page with the tag information.
|