line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Audio::File::Mp3::AudioProperties; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
39
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
36
|
|
5
|
1
|
|
|
1
|
|
7
|
use base qw( Audio::File::AudioProperties ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
98
|
|
6
|
1
|
|
|
1
|
|
1192
|
use MP3::Info; |
|
1
|
|
|
|
|
505356
|
|
|
1
|
|
|
|
|
226
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub init { |
11
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
12
|
1
|
50
|
|
|
|
14
|
my $info = get_mp3info( $self->{filename} ) or return; |
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
|
|
512
|
$self->length( $info->{SECS} ); |
15
|
1
|
|
|
|
|
8
|
$self->bitrate( $info->{BITRATE} ); |
16
|
1
|
|
|
|
|
8
|
$self->sample_rate( $info->{FREQUENCY} * 1000 ); |
17
|
1
|
50
|
|
|
|
11
|
$self->channels( $info->{STEREO} ? 2 : 1 ); |
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
|
|
6
|
return 1; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
1; |