NAME
MPEG::MP3Tag - Manipulate / fetch TAG and header info from a MP3 audio file
SYNOPSIS
#!perl -w
use MPEG::MP3Tag;
my $file = 'Pearls_Before_Swine.mp3';
set_mp3tag($file, 'Pearls Before Swine', q"77's",
'Sticks and Stones', '1990', q"(c) 1990 77's LTD.", 'rock & roll');
my $tag = get_mp3tag($file) or die "No TAG info";
$tag->{GENRE} = 'rock';
set_mp3tag($file, $tag);
my $info = get_mp3info($file);
printf "$file length is %d:%d", $info->{MM}, $info->{SS};
DESCRIPTION
- set_mp3tag (FILE, TITLE, ARTIST, ALBUM, YEAR, COMMENT, GENRE)
- set_mp3tag (FILE, $HASHREF)
-
Adds/changes tag information in an MP3 audio file. Will clobber any existing information in file. All fields have a 30-byte limit, except for YEAR, which has a four-byte limit.
GENRE is a case-insensitive text string representing a genre found in
@mp3_genres
.Will accept either a list of values, or a hashref of the type returned by
get_mp3tag
. - get_mp3tag (FILE)
-
Returns hash reference containing tag information in MP3 file. Same info as described in
set_mp3tag
. You can't change this data. - get_mp3info (FILE)
-
Returns hash reference containing file information for MP3 file.
HISTORY
- v0.12, Friday, October 2, 1998
-
Added
get_mp3info
. Thanks again to mp3tool source from Johann Lindvall, because I basically stole it straight (after converting it from C to Perl, of course).I did everything I could to find the header info, but if anyone has valid MP3 files that are not recognized, or has suggestions for improvement of the algorithms, let me know.
- v0.04, Tuesday, September 29, 1998
-
Changed a few things, replaced a regex with an
unpack
(Meng Weng Wong <mengwong@pobox.com>). - v0.03, Tuesday, September 8, 1998
-
First public release.
AUTHOR AND COPYRIGHT
Chris Nandor <pudge@pobox.com> http://pudge.net/
Copyright (c) 1998 Chris Nandor. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Please see the Perl Artistic License.
Thanks to Johann Lindvall for his mp3tool program:
http://www.dtek.chalmers.se/~d2linjo/mp3/mp3tool.html
Helped me figure it all out.
VERSION
v0.12, Friday, October 2, 1998
2 POD Errors
The following errors were encountered while parsing the POD:
- Around line 43:
'=item' outside of any '=over'
- Around line 345:
You forgot a '=back' before '=head1'