in reply to RE: RE: File identifier
in thread File identifier

Useful Script.  
How did you know to use:
"\xFF\xF0-\xFF"
for identifying MP3 files?

I have tried unpack and sprintf, but I'm guessing I'm using those funcions wrong.

Replies are listed 'Best First'.
Re: Re: RE: RE: File identifier
by Corion (Patriarch) on Sep 07, 2003 at 20:04 UTC

    The sequence of 12 "one" bits, starting at a byte boundary, is what the MPEG audio layer 3 spec says :-) See http://www.euronet.nl/~soloh/mpegEnc/textfiles/mpeg-AFS.txt for example, I didn't come up with a better thing in the minute I searched Google ;-)

    perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web