getid3_riff::parseWAVEFORMATex() –

You appear to be a bot. Output may be restricted

Description

Usage

$array = getid3_riff::parseWAVEFORMATex( $WaveFormatExData );

Parameters

$WaveFormatExData
( string ) required

Returns

array

Source

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

1 to 25 of 25
  public static function parseWAVEFORMATex($WaveFormatExData) {
    // shortcut
    $WaveFormatEx        = array();
    $WaveFormatEx['raw'] = array();
    $WaveFormatEx_raw    = &$WaveFormatEx['raw'];

    $WaveFormatEx_raw['wFormatTag']      = substr($WaveFormatExData,  0, 2);
    $WaveFormatEx_raw['nChannels']       = substr($WaveFormatExData,  2, 2);
    $WaveFormatEx_raw['nSamplesPerSec']  = substr($WaveFormatExData,  4, 4);
    $WaveFormatEx_raw['nAvgBytesPerSec'] = substr($WaveFormatExData,  8, 4);
    $WaveFormatEx_raw['nBlockAlign']     = substr($WaveFormatExData, 12, 2);
    $WaveFormatEx_raw['wBitsPerSample']  = substr($WaveFormatExData, 14, 2);
    if (strlen($WaveFormatExData) > 16) {
      $WaveFormatEx_raw['cbSize']      = substr($WaveFormatExData, 16, 2);
    }
    $WaveFormatEx_raw = array_map('getid3_lib::LittleEndian2Int', $WaveFormatEx_raw);

    $WaveFormatEx['codec']           = self::wFormatTagLookup($WaveFormatEx_raw['wFormatTag']);
    $WaveFormatEx['channels']        = $WaveFormatEx_raw['nChannels'];
    $WaveFormatEx['sample_rate']     = $WaveFormatEx_raw['nSamplesPerSec'];
    $WaveFormatEx['bitrate']         = $WaveFormatEx_raw['nAvgBytesPerSec'] * 8;
    $WaveFormatEx['bits_per_sample'] = $WaveFormatEx_raw['wBitsPerSample'];

    return $WaveFormatEx;
  }
 

 View on GitHub View on Trac