| 1 | package File::Headerinfo::MP3; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use base qw(File::Headerinfo); | ||
| 5 | use MP3::Info; | ||
| 6 | |||
| 7 | =head1 NAME | ||
| 8 | |||
| 9 | File::Headerinfo::MP3 - an extractor of useful information from mp3 files. | ||
| 10 | |||
| 11 | =head1 DESCRIPTION | ||
| 12 | |||
| 13 | I<File::Headerinfo::MP3> uses MP3::Info to read the headers of .mp3 files and extract descriptive information and metadata. | ||
| 14 | |||
| 15 | =cut | ||
| 16 | |||
| 17 | sub parse_file { | ||
| 18 | my $self = shift; | ||
| 19 | my $mp3 = MP3::Info::get_mp3info($self->path); | ||
| 20 | my $tags = MP3::Info::get_mp3tag($self->path); | ||
| 21 | |||
| 22 | $self->filetype('mp3'); | ||
| 23 | $self->duration($mp3->{SECS}); | ||
| 24 | $self->datarate($mp3->{BITRATE}); | ||
| 25 | $self->freq($mp3->{FREQUENCY}); | ||
| 26 | $self->filesize($mp3->{SIZE}); | ||
| 27 | $self->metadata($tags) | ||
| 28 | } | ||
| 29 | |||
| 30 | =head1 COPYRIGHT | ||
| 31 | |||
| 32 | Copyright 2004 William Ross (wross@cpan.org) | ||
| 33 | |||
| 34 | This library is free software; you can redistribute it | ||
| 35 | and/or modify it under the same terms as Perl itself. | ||
| 36 | |||
| 37 | =head1 SEE ALSO | ||
| 38 | |||
| 39 | L<File::Headerinfo>, L<MP3::Info> | ||
| 40 | |||
| 41 | =cut | ||
| 42 | |||
| 43 | 1; |