Wav::ReadSection: User Contributed Perl Documentation (3)Updated: 2001-08-25 |
Wav::ReadSection: User Contributed Perl Documentation (3)Updated: 2001-08-25 |
use Audio::Wav;
my $wav = new Audio::Wav;
my $read = $wav -> read( 'filename.wav' );
my $details = $read -> details();
my $file = $read -> file_name();
my $info = $read -> get_info();
Returns a reference to a hash containing; (for example, a file marked up for use in Audio::Mix)
{
'keywords' => 'bpm:126 key:a',
'name' => 'Mission Venice',
'artist' => 'Nightmares on Wax'
};
my $cues = $read -> get_cues();
Returns a reference to a hash containing; (for example, a file marked up for use in Audio::Mix) (position is byte offset)
{
1 => {
label => 'sig',
position => 764343,
note => 'first'
},
2 => {
label => 'fade_in',
position => 1661774,
note => 'trig'
},
3 => {
label => 'sig',
position => 18033735,
note => 'last'
},
4 => {
label => 'fade_out',
position => 17145150,
note => 'trig'
},
5 => {
label => 'end',
position => 18271676
}
}
my $data = $self -> read_raw( $byte_length );
my @channels = $self -> read();
Returns an array of unpacked samples. Each element is a channel i.e ( left, right ). The numbers will be in the range;
where $samp_max = ( 2 ** bits_per_sample ) / 2
-$samp_max to +$samp_max
my $byte_offset = $read -> position();
$read -> move_to( $byte_offset );
$read -> move_to_sample( $sample_offset );
my $audio_bytes = $read -> length();
my $audio_samples = $read -> length_samples();
my $audio_seconds = $read -> length_seconds();
use Data::Dumper;
my $details = $read -> details();
print Data::Dumper->Dump([ $details ]);
Nick Peskett <cpan@peskett.com>.
Kurt George Gjerde <kurt.gjerde@media.uib.no>. (0.02)