getid3_ac3::Analyze() –

You appear to be a bot. Output may be restricted

Description

Usage

$bool = getid3_ac3::Analyze();

Parameters

Returns

bool

Source

File name: wordpress/wp-includes/ID3/module.audio.ac3.php
Lines:

301 to 400 of 449
                }
              }
            }
            $mixdata_bits = (8 * ($thisfile_ac3_raw_bsi['mixdeflen'] + 2)) - $mixdefbitsread;
            $mixdata_fill = (($mixdata_bits % 8) ? 8 - ($mixdata_bits % 8) : 0);
            $thisfile_ac3_raw_bsi['mixdata']     =        $this->getid3_ac3::readHeaderBSI($mixdata_bits);
            $thisfile_ac3_raw_bsi['mixdatafill'] =        $this->getid3_ac3::readHeaderBSI($mixdata_fill);
            unset($mixdefbitsread, $mixdata_bits, $mixdata_fill);
          }
          if ($thisfile_ac3_raw_bsi['acmod'] < 2) { // if mono or dual mono source
            $thisfile_ac3_raw_bsi['flags']['paninfo'] = (bool) $this->getid3_ac3::readHeaderBSI(1);
            if ($thisfile_ac3_raw_bsi['flags']['paninfo']) {
              $thisfile_ac3_raw_bsi['panmean']   =        $this->getid3_ac3::readHeaderBSI(8);
              $thisfile_ac3_raw_bsi['paninfo']   =        $this->getid3_ac3::readHeaderBSI(6);
            }
            if ($thisfile_ac3_raw_bsi['acmod'] == 0) { // if 1+1 mode (dual mono, so some items need a second value)
              $thisfile_ac3_raw_bsi['flags']['paninfo2'] = (bool) $this->getid3_ac3::readHeaderBSI(1);
              if ($thisfile_ac3_raw_bsi['flags']['paninfo2']) {
                $thisfile_ac3_raw_bsi['panmean2']   =        $this->getid3_ac3::readHeaderBSI(8);
                $thisfile_ac3_raw_bsi['paninfo2']   =        $this->getid3_ac3::readHeaderBSI(6);
              }
            }
          }
          $thisfile_ac3_raw_bsi['flags']['frmmixcfginfo'] = (bool) $this->getid3_ac3::readHeaderBSI(1);
          if ($thisfile_ac3_raw_bsi['flags']['frmmixcfginfo']) { // mixing configuration information
            if ($thisfile_ac3_raw_bsi['numblkscod'] == 0) {
              $thisfile_ac3_raw_bsi['blkmixcfginfo'][0]  =        $this->getid3_ac3::readHeaderBSI(5);
            } else {
              for ($blk = 0; $blk < $thisfile_ac3_raw_bsi['numblkscod']; $blk++) {
                $thisfile_ac3_raw_bsi['flags']['blkmixcfginfo'.$blk] = (bool) $this->getid3_ac3::readHeaderBSI(1);
                if ($thisfile_ac3_raw_bsi['flags']['blkmixcfginfo'.$blk]) { // mixing configuration information
                  $thisfile_ac3_raw_bsi['blkmixcfginfo'][$blk]  =        $this->getid3_ac3::readHeaderBSI(5);
                }
              }
            }
          }
        }
      }
      $thisfile_ac3_raw_bsi['flags']['infomdat']          = (bool) $this->getid3_ac3::readHeaderBSI(1);
      if ($thisfile_ac3_raw_bsi['flags']['infomdat']) { // Informational metadata
        $thisfile_ac3_raw_bsi['bsmod']                  =        $this->getid3_ac3::readHeaderBSI(3);
        $thisfile_ac3_raw_bsi['flags']['copyrightb']    = (bool) $this->getid3_ac3::readHeaderBSI(1);
        $thisfile_ac3_raw_bsi['flags']['origbs']        = (bool) $this->getid3_ac3::readHeaderBSI(1);
        if ($thisfile_ac3_raw_bsi['acmod'] == 2) { //  if in 2/0 mode
          $thisfile_ac3_raw_bsi['dsurmod']            =        $this->getid3_ac3::readHeaderBSI(2);
          $thisfile_ac3_raw_bsi['dheadphonmod']       =        $this->getid3_ac3::readHeaderBSI(2);
        }
        if ($thisfile_ac3_raw_bsi['acmod'] >= 6) { //  if both surround channels exist
          $thisfile_ac3_raw_bsi['dsurexmod']          =        $this->getid3_ac3::readHeaderBSI(2);
        }
        $thisfile_ac3_raw_bsi['flags']['audprodi']      = (bool) $this->getid3_ac3::readHeaderBSI(1);
        if ($thisfile_ac3_raw_bsi['flags']['audprodi']) {
          $thisfile_ac3_raw_bsi['mixlevel']           =        $this->getid3_ac3::readHeaderBSI(5);
          $thisfile_ac3_raw_bsi['roomtyp']            =        $this->getid3_ac3::readHeaderBSI(2);
          $thisfile_ac3_raw_bsi['flags']['adconvtyp'] = (bool) $this->getid3_ac3::readHeaderBSI(1);
        }
        if ($thisfile_ac3_raw_bsi['acmod'] == 0) { //  if 1+1 mode (dual mono, so some items need a second value)
          $thisfile_ac3_raw_bsi['flags']['audprodi2']      = (bool) $this->getid3_ac3::readHeaderBSI(1);
          if ($thisfile_ac3_raw_bsi['flags']['audprodi2']) {
            $thisfile_ac3_raw_bsi['mixlevel2']           =        $this->getid3_ac3::readHeaderBSI(5);
            $thisfile_ac3_raw_bsi['roomtyp2']            =        $this->getid3_ac3::readHeaderBSI(2);
            $thisfile_ac3_raw_bsi['flags']['adconvtyp2'] = (bool) $this->getid3_ac3::readHeaderBSI(1);
          }
        }
        if ($thisfile_ac3_raw_bsi['fscod'] < 3) { // if not half sample rate
          $thisfile_ac3_raw_bsi['flags']['sourcefscod'] = (bool) $this->getid3_ac3::readHeaderBSI(1);
        }
      }
      if (($thisfile_ac3_raw_bsi['strmtyp'] == 0) && ($thisfile_ac3_raw_bsi['numblkscod'] != 3)) { //  if both surround channels exist
        $thisfile_ac3_raw_bsi['flags']['convsync'] = (bool) $this->getid3_ac3::readHeaderBSI(1);
      }
      if ($thisfile_ac3_raw_bsi['strmtyp'] == 2) { //  if bit stream converted from AC-3
        if ($thisfile_ac3_raw_bsi['numblkscod'] != 3) { // 6 blocks per syncframe
          $thisfile_ac3_raw_bsi['flags']['blkid']  = 1;
        } else {
          $thisfile_ac3_raw_bsi['flags']['blkid']  = (bool) $this->getid3_ac3::readHeaderBSI(1);
        }
        if ($thisfile_ac3_raw_bsi['flags']['blkid']) {
          $thisfile_ac3_raw_bsi['frmsizecod']  =        $this->getid3_ac3::readHeaderBSI(6);
        }
      }
      $thisfile_ac3_raw_bsi['flags']['addbsi']  = (bool) $this->getid3_ac3::readHeaderBSI(1);
      if ($thisfile_ac3_raw_bsi['flags']['addbsi']) {
        $thisfile_ac3_raw_bsi['addbsil']  =        $this->getid3_ac3::readHeaderBSI(6);
        $thisfile_ac3_raw_bsi['addbsi']   =        $this->getid3_ac3::readHeaderBSI(($thisfile_ac3_raw_bsi['addbsil'] + 1) * 8);
      }

    } else {

      $this->error('Bit stream identification is version '.$thisfile_ac3_raw_bsi['bsid'].', but getID3() only understands up to version 16. Please submit a support ticket with a sample file.');
      unset($info['ac3']);
      return false;

    }

    if (isset($thisfile_ac3_raw_bsi['fscod2'])) {
      $thisfile_ac3['sample_rate'] = self::sampleRateCodeLookup2($thisfile_ac3_raw_bsi['fscod2']);
    } else {
      $thisfile_ac3['sample_rate'] = self::sampleRateCodeLookup($thisfile_ac3_raw_bsi['fscod']);
    }
 

 View on GitHub View on Trac