This is the code that fetches information about each MP3 file.
sub fetch_info {
my $file = shift;
return unless my $info = get_mp3info($file);
my $tag = get_mp3tag($file);
my ($title,$artist,$album,$year,$comment,$genre,$duration,$bps);
if ($tag) {
($title,$artist,$album,$year,$comment,$genre) = @{$tag}{qw(TITLE ARTIST ALBUM YEAR COMMENT GENRE)};
}
$duration = "$info->{MM}m $info->{SS}s";
$bps = "$info->{BITRATE} bps";
return { title => $title,
artist => $artist,
duration => $duration,
bps => $bps,
genre => $genre,
album => $album,
comment => $comment,
};
}
|
|
| Contents | Next |