File::Headerinfo::MP3 - an extractor of useful information from mp3 files.


File-Headerinfo documentation Contained in the File-Headerinfo distribution.

Index


Code Index:

NAME

Top

File::Headerinfo::MP3 - an extractor of useful information from mp3 files.

DESCRIPTION

Top

File::Headerinfo::MP3 uses MP3::Info to read the headers of .mp3 files and extract descriptive information and metadata.

COPYRIGHT

Top

SEE ALSO

Top

File::Headerinfo, MP3::Info


File-Headerinfo documentation Contained in the File-Headerinfo distribution.
package File::Headerinfo::MP3;

use strict;
use base qw(File::Headerinfo);
use MP3::Info;

sub parse_file {
    my $self = shift;
    my $mp3 = MP3::Info::get_mp3info($self->path);
    my $tags = MP3::Info::get_mp3tag($self->path);
    
    $self->filetype('mp3');
    $self->duration($mp3->{SECS});
    $self->datarate($mp3->{BITRATE});
    $self->freq($mp3->{FREQUENCY});
    $self->filesize($mp3->{SIZE});
    $self->metadata($tags)
}

1;