Audio-Mad

 view release on metacpan or  search on metacpan

lib/Audio/Mad/Util.pm  view on Meta::CPAN

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
our %EXPORT_TAGS = ( all => [@EXPORT_OK] );
 
sub mad_stream_info {
        my ($fh, $do_toc, $do_ex) = @_;
        my ($h, $buf) = ({}, '');
 
        $do_toc = 0 unless (defined($do_toc) && $do_toc ne '');
        $do_ex  = 1 unless (defined($do_ex)  && $do_ex  ne '');
         
        ## fail if file is zero bytes in length
        return undef if (($h->{f_size} = (stat($fh))[7]) == 0);
         
        ## get a new stream object and turn off crc
        ## checking,  as many encoders are broken
        ## and it isn't too terribly useful in decoding but
        ## works nicely for checking stream validity.
 
        ## creates a mad_stream structure
        my $stream = new Audio::Mad::Stream(MAD_OPTION_IGNORECRC);
 
        ## creates a mad_frame structure



( run in 0.226 second using v1.01-cache-2.11-cpan-0f795438458 )