MP3::Tag::ID3v2 0.9708 review

Download
by rbytes.net on

License: Perl Artistic License
File size: 175K
Developer: Thomas Geffert
0 stars award from rbytes.net

MP3::Tag::ID3v2 is a Read / Write ID3v2.x.y tags from mp3 audio files.

SYNOPSIS

MP3::Tag::ID3v2 supports * Reading of ID3v2.2.0 and ID3v2.3.0 tags (some ID3v2.4.0 frames too) * Writing of ID3v2.3.0 tags

MP3::Tag::ID3v2 is designed to be called from the MP3::Tag module.

use MP3::Tag;
$mp3 = MP3::Tag->new($filename);

# read an existing tag
$mp3->get_tags();
$id3v2 = $mp3->{ID3v2} if exists $mp3->{ID3v2};

# or create a new tag
$id3v2 = $mp3->new_tag("ID3v2");

See MP3::Tag for information on the above used functions.

* Reading a tag

$frameIDs_hash = $id3v2->get_frame_ids('truename');

foreach my $frame (keys %$frameIDs_hash) {
my ($name, @info) = $id3v2->get_frame($frame);
for my $info (@info) {
if (ref $info) {
print "$name ($frame):n";
while(my ($key,$val)=each %$info) {
print " * $key => $valn";
}
} else {
print "$name: $infon";
}
}
}
* Adding / Changing / Removing / Writing a tag
$id3v2->add_frame("TIT2", "Title of the song");
$id3v2->change_frame("TALB","Greatest Album");
$id3v2->remove_frame("TLAN");
$id3v2->write_tag();
* Removing the whole tag
$id3v2->remove_tag();
* Get information about supported frames
%tags = $id3v2->supported_frames();
while (($fname, $longname) = each %tags) {
print "$fname $longname: ",
join(", ", @{$id3v2->what_data($fname)}), "n";
}

Requirements:
Perl

MP3::Tag::ID3v2 0.9708 search tags