public static function unpackSampleBlock($sampleBlock, $bitDepth, $numChannels = null) {
        $sampleBytes = $bitDepth / 8;
        if ($numChannels === null) {
            $numChannels = strlen($sampleBlock) / $sampleBytes;
        }

        $samples = array();
        for ($i = 0; $i < $numChannels; $i++) {
            $sampleBinary = substr($sampleBlock, $i * $sampleBytes, $sampleBytes);
            $samples[$i + 1] = self::unpackSample($sampleBinary, $bitDepth);
        }

        return $samples;
    }
public static function unpackSampleBlock($sampleBlock, $bitDepth, $numChannels = null) {
        $sampleBytes = $bitDepth / 8;
        if ($numChannels === null) {
            $numChannels = strlen($sampleBlock) / $sampleBytes;
        }

        $samples = array();
        for ($i = 0; $i < $numChannels; $i++) {
            $sampleBinary = substr($sampleBlock, $i * $sampleBytes, $sampleBytes);
            $samples[$i + 1] = self::unpackSample($sampleBinary, $bitDepth);
        }

        return $samples;
    }
public static function unpackSampleBlock ( $ sampleBlock , $ bitDepth , $ numChannels = null ) { $ sampleBytes = $ bitDepth / 8 ; if ( $ numChannels === null ) { $ numChannels = strlen ( $ sampleBlock ) / $ sampleBytes ; } $ samples = array ( ) ; for ( $ i = 0 ; $ i < $ numChannels ; $ i ++ ) { $ sampleBinary = substr ( $ sampleBlock , $ i * $ sampleBytes , $ sampleBytes ) ; $ samples [ $ i + 1 ] = self :: unpackSample ( $ sampleBinary , $ bitDepth ) ; } return $ samples ; }
Unpacks a binary sample block to numeric values.

@param string $sampleBlock  (Required) The binary sample block (all channels).
@param int $bitDepth  (Required) The bits per sample to decode.
@param int $numChannels  (Optional) The number of channels to decode. If omitted, derives it from the length of $sampleBlock and $bitDepth.
@return array  The sample values as an array of integers of floats for 32 bits. First channel is array index 1.
Unpacks a binary sample block to numeric values .