| 1 | package File::Headerinfo::WAV; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use base qw(File::Headerinfo); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use Audio::Wav; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | =head1 NAME | ||||||||||
| 8 | |||||||||||
| 9 | File::Headerinfo::WAV - an extractor of useful information from WAV files. | ||||||||||
| 10 | |||||||||||
| 11 | =head1 DESCRIPTION | ||||||||||
| 12 | |||||||||||
| 13 | I<File::Headerinfo::WAV> uses Audio::WAV to read the headers of .wav files and extract useful information like their duration and filesize and, er, that's it at the moment. | ||||||||||
| 14 | |||||||||||
| 15 | =cut | ||||||||||
| 16 | |||||||||||
| 17 | 1 | ▶ | sub parse_file { | ||||||||
|
Subroutine
parse_file: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 18 | 1 | my $self = shift; | |||||||||
| 19 | 1 | my $w = Audio::Wav->new; | |||||||||
| 20 | 1 | my $info = $w->read($self->path); | |||||||||
| 21 | 1 | ▶ | return unless $info; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | 1 | my $details = $info->details; | |||||||||
| 23 | |||||||||||
| 24 | 1 | $self->filetype( 'wav' ); | |||||||||
| 25 | 1 | $self->filesize($info->length); | |||||||||
| 26 | 1 | $self->duration($info->length_seconds); | |||||||||
| 27 | 1 | $self->metadata($info->get_info); | |||||||||
| 28 | 1 | $self->freq($details->{sample_rate}); | |||||||||
| 29 | 1 | $self->datarate($details->{bytes_sec}); | |||||||||
| 30 | |||||||||||
| 31 | 1 | undef $info; | |||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | =head1 COPYRIGHT | ||||||||||
| 35 | |||||||||||
| 36 | Copyright 2004 William Ross (wross@cpan.org) | ||||||||||
| 37 | |||||||||||
| 38 | This library is free software; you can redistribute it | ||||||||||
| 39 | and/or modify it under the same terms as Perl itself. | ||||||||||
| 40 | |||||||||||
| 41 | =head1 SEE ALSO | ||||||||||
| 42 | |||||||||||
| 43 | L<File::Headerinfo>, L<Audio::WAV> | ||||||||||
| 44 | |||||||||||
| 45 | =cut | ||||||||||
| 46 | |||||||||||
| 47 | 1 | 1; | |||||||||