Exemplo n.º 1
0
function ParseRIFFdata(&$RIFFdata, &$ThisFileInfo)
{
    if ($RIFFdata) {
        if ($fp_temp = tmpfile()) {
            $RIFFdataLength = strlen($RIFFdata);
            $NewLengthString = LittleEndian2String($RIFFdataLength, 4);
            for ($i = 0; $i < 4; $i++) {
                $RIFFdata[$i + 4] = $NewLengthString[$i];
            }
            fwrite($fp_temp, $RIFFdata);
            $dummy = array('filesize' => $RIFFdataLength, 'filenamepath' => $ThisFileInfo['filenamepath'], 'tags' => $ThisFileInfo['tags'], 'avdataoffset' => 0, 'avdataend' => $RIFFdataLength, 'warning' => $ThisFileInfo['warning'], 'error' => $ThisFileInfo['error'], 'comments' => $ThisFileInfo['comments']);
            if (getRIFFHeaderFilepointer($fp_temp, $dummy)) {
                $ThisFileInfo['RIFF'] = $dummy['RIFF'];
                $ThisFileInfo['warning'] = $dummy['warning'];
                $ThisFileInfo['error'] = $dummy['error'];
                $ThisFileInfo['tags'] = $dummy['tags'];
                $ThisFileInfo['comments'] = $dummy['comments'];
            }
            fclose($fp_temp);
            return true;
        } else {
            $ThisFileInfo['error'] .= "\n" . 'Error calling tmpfile() to parse OptimFROG RIFF header';
        }
    }
    return false;
}
Exemplo n.º 2
0
function GenerateAPEtagHeaderFooter(&$items, $isheader = false)
{
    $tagdatalength = 0;
    foreach ($items as $itemdata) {
        $tagdatalength += strlen($itemdata);
    }
    $APEheader = 'APETAGEX';
    $APEheader .= LittleEndian2String(2000, 4);
    $APEheader .= LittleEndian2String(32 + $tagdatalength, 4);
    $APEheader .= LittleEndian2String(count($items), 4);
    $APEheader .= GenerateAPEtagFlags(true, true, $isheader, 0, false);
    $APEheader .= str_repeat(chr(0), 8);
    return $APEheader;
}