src/Mp3Info.php
static public function isValidAudio($filename) {
        if (!file_exists($filename))
            throw new Exception('File '.$filename.' is not present!');
        $raw = file_get_contents($filename, false, null, 0, 3);
        return ($raw == self::TAG2_SYNC || (self::FRAME_SYNC == (unpack('n*', $raw)[1] & self::FRAME_SYNC)));
    }
static public function isValidAudio($filename) {
        if (!file_exists($filename))
            throw new Exception('File '.$filename.' is not present!');
        $raw = file_get_contents($filename, false, null, 0, 3);
        return ($raw == self::TAG2_SYNC || (self::FRAME_SYNC == (unpack('n*', $raw)[1] & self::FRAME_SYNC)));
    }
static public function isValidAudio ( $ filename ) { if ( ! file_exists ( $ filename ) ) throw new Exception ( 'File ' . $ filename . ' is not present!' ) ; $ raw = file_get_contents ( $ filename , false , null , 0 , 3 ) ; return ( $ raw == self :: TAG2_SYNC || ( self :: FRAME_SYNC == ( unpack ( 'n*' , $ raw ) [ 1 ] & self :: FRAME_SYNC ) ) ) ; }
Simple function that checks mpeg-audio correctness of given file.
Actually it checks that first 3 bytes of file is a id3v2 tag mark or
that first 11 bits of file is a frame header sync mark. To perform full
test create an instance of Mp3Info with given file.

@param string $filename File to be tested.

@return boolean True if file is looks correct, False otherwise.
@throws \Exception
Simple function that checks mpeg - audio correctness of given file . Actually it checks that first 3 bytes of file is a id3v2 tag mark or that first 11 bits of file is a frame header sync mark . To perform full test create an instance of Mp3Info with given file .