File Coverage

blib/lib/Audio/File/Ogg/AudioProperties.pm
Criterion Covered Total %
statement 20 20 100.0
branch 1 2 50.0
condition n/a
subroutine 5 5 100.0
pod 1 1 100.0
total 27 28 96.4


line stmt bran cond sub pod time code
1             package Audio::File::Ogg::AudioProperties;
2              
3 1     1   7 use strict;
  1         2  
  1         50  
4 1     1   7 use warnings;
  1         2  
  1         38  
5 1     1   6 use base qw( Audio::File::AudioProperties );
  1         2  
  1         109  
6 1     1   6 use Ogg::Vorbis::Header::PurePerl;
  1         3  
  1         255  
7              
8             our $VERSION = '0.01';
9              
10             sub init {
11 1     1 1 3 my $self = shift;
12 1 50       11 $self->{ogg} = Ogg::Vorbis::Header::PurePerl->new( $self->{filename} ) or return;
13 1         5750 my $ogginfo = $self->{ogg}->info();
14              
15 1         134 $self->length( $ogginfo->{length} );
16 1         10 $self->bitrate( $ogginfo->{bitrate_nominal} );
17 1         8 $self->sample_rate( $ogginfo->{rate} );
18 1         8 $self->channels( $ogginfo->{channels} );
19              
20 1         5 return 1;
21             }
22              
23             1;