Audio-Mad

 view release on metacpan or  search on metacpan

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

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 1.092 second using v1.01-cache-2.11-cpan-49f99fa48dc )