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:

401 to 449 of 449
    if ($thisfile_ac3_raw_bsi['fscod'] <= 3) {
      $info['audio']['sample_rate'] = $thisfile_ac3['sample_rate'];
    } else {
      $this->warning('Unexpected ac3.bsi.fscod value: '.$thisfile_ac3_raw_bsi['fscod']);
    }
    if (isset($thisfile_ac3_raw_bsi['frmsizecod'])) {
      $thisfile_ac3['frame_length'] = self::frameSizeLookup($thisfile_ac3_raw_bsi['frmsizecod'], $thisfile_ac3_raw_bsi['fscod']);
      $thisfile_ac3['bitrate']      = self::bitrateLookup($thisfile_ac3_raw_bsi['frmsizecod']);
    } elseif (!empty($thisfile_ac3_raw_bsi['frmsiz'])) {
      // this isn't right, but it's (usually) close, roughly 5% less than it should be.
      // but WHERE is the actual bitrate value stored in EAC3?? email info@getid3.org if you know!
      $thisfile_ac3['bitrate']      = ($thisfile_ac3_raw_bsi['frmsiz'] + 1) * 16 * 30; // The frmsiz field shall contain a value one less than the overall size of the coded syncframe in 16-bit words. That is, this field may assume a value ranging from 0 to 2047, and these values correspond to syncframe sizes ranging from 1 to 2048.
      // kludge-fix to make it approximately the expected value, still not "right":
      $thisfile_ac3['bitrate'] = round(($thisfile_ac3['bitrate'] * 1.05) / 16000) * 16000;
    }
    $info['audio']['bitrate'] = $thisfile_ac3['bitrate'];

    if (isset($thisfile_ac3_raw_bsi['bsmod']) && isset($thisfile_ac3_raw_bsi['acmod'])) {
      $thisfile_ac3['service_type'] = self::serviceTypeLookup($thisfile_ac3_raw_bsi['bsmod'], $thisfile_ac3_raw_bsi['acmod']);
    }
    $ac3_coding_mode = self::audioCodingModeLookup($thisfile_ac3_raw_bsi['acmod']);
    foreach($ac3_coding_mode as $key => $value) {
      $thisfile_ac3[$key] = $value;
    }
    switch ($thisfile_ac3_raw_bsi['acmod']) {
      case 0:
      case 1:
        $info['audio']['channelmode'] = 'mono';
        break;
      case 3:
      case 4:
        $info['audio']['channelmode'] = 'stereo';
        break;
      default:
        $info['audio']['channelmode'] = 'surround';
        break;
    }
    $info['audio']['channels'] = $thisfile_ac3['num_channels'];

    $thisfile_ac3['lfe_enabled'] = $thisfile_ac3_raw_bsi['flags']['lfeon'];
    if ($thisfile_ac3_raw_bsi['flags']['lfeon']) {
      $info['audio']['channels'] .= '.1';
    }

    $thisfile_ac3['channels_enabled'] = self::channelsEnabledLookup($thisfile_ac3_raw_bsi['acmod'], $thisfile_ac3_raw_bsi['flags']['lfeon']);
    $thisfile_ac3['dialogue_normalization'] = '-'.$thisfile_ac3_raw_bsi['dialnorm'].'dB';

    return true;
  }
 

 View on GitHub View on Trac