本文整理汇总了PHP中getid3_riff::RIFFCommentsParse方法的典型用法代码示例。如果您正苦于以下问题:PHP getid3_riff::RIFFCommentsParse方法的具体用法?PHP getid3_riff::RIFFCommentsParse怎么用?PHP getid3_riff::RIFFCommentsParse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类getid3_riff
的用法示例。
在下文中一共展示了getid3_riff::RIFFCommentsParse方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Analyze
//.........这里部分代码省略.........
// ID_RIFF_HEADER
$original_wav_filesize = getid3_lib::LittleEndian2Int(substr($metablock['data'], 4, 4));
// Clone getid3
$clone = clone $getid3;
// Analyze clone by string
$riff = new getid3_riff($clone);
$riff->AnalyzeString($metablock['data']);
// Import from clone and destroy
$metablock['riff'] = $clone->info['riff'];
$getid3->warnings($clone->warnings());
unset($clone);
// Save RIFF header - we may need it later for RIFF footer parsing
$this->riff_header = $metablock['data'];
$metablock['riff']['original_filesize'] = $original_wav_filesize;
$info_wavpack['riff_trailer_size'] = $original_wav_filesize - $metablock['riff']['WAVE']['data'][0]['size'] - $metablock['riff']['header_size'];
$getid3->info['audio']['sample_rate'] = $metablock['riff']['raw']['fmt ']['nSamplesPerSec'];
$getid3->info['playtime_seconds'] = $info_wavpack_blockheader['total_samples'] / $getid3->info['audio']['sample_rate'];
// Safe RIFF header in case there's a RIFF footer later
$metablock_riff_header = $metablock['data'];
break;
case 0x22:
// ID_RIFF_TRAILER
$metablock_riff_footer = $metablock_riff_header . $metablock['data'];
$start_offset = $metablock['offset'] + ($metablock['large_block'] ? 4 : 2);
$ftell_old = ftell($getid3->fp);
// Clone getid3
$clone = clone $getid3;
// Call public method that really should be private
$riff = new getid3_riff($clone);
$metablock['riff'] = $riff->ParseRIFF($start_offset, $start_offset + $metablock['size']);
unset($clone);
fseek($getid3->fp, $ftell_old, SEEK_SET);
if (!empty($metablock['riff']['INFO'])) {
getid3_riff::RIFFCommentsParse($metablock['riff']['INFO'], $metablock['comments']);
$getid3->info['tags']['riff'] = $metablock['comments'];
}
break;
case 0x23:
// ID_REPLAY_GAIN
$getid3->warning('WavPack "Replay Gain" contents not yet handled by getID3() in metablock at offset ' . $metablock['offset']);
break;
case 0x24:
// ID_CUESHEET
$getid3->warning('WavPack "Cuesheet" contents not yet handled by getID3() in metablock at offset ' . $metablock['offset']);
break;
case 0x25:
// ID_CONFIG_BLOCK
$metablock['flags_raw'] = getid3_lib::LittleEndian2Int(substr($metablock['data'], 0, 3));
$metablock['flags']['adobe_mode'] = (bool) ($metablock['flags_raw'] & 0x1);
// "adobe" mode for 32-bit floats
$metablock['flags']['fast_flag'] = (bool) ($metablock['flags_raw'] & 0x2);
// fast mode
$metablock['flags']['very_fast_flag'] = (bool) ($metablock['flags_raw'] & 0x4);
// double fast
$metablock['flags']['high_flag'] = (bool) ($metablock['flags_raw'] & 0x8);
// high quality mode
$metablock['flags']['very_high_flag'] = (bool) ($metablock['flags_raw'] & 0x10);
// double high (not used yet)
$metablock['flags']['bitrate_kbps'] = (bool) ($metablock['flags_raw'] & 0x20);
// bitrate is kbps, not bits / sample
$metablock['flags']['auto_shaping'] = (bool) ($metablock['flags_raw'] & 0x40);
// automatic noise shaping
$metablock['flags']['shape_override'] = (bool) ($metablock['flags_raw'] & 0x80);
// shaping mode specified
$metablock['flags']['joint_override'] = (bool) ($metablock['flags_raw'] & 0x100);
// joint-stereo mode specified
示例2: Analyze
//.........这里部分代码省略.........
} else {
// Clone getid3 - messing with offsets - better safe than sorry
$clone = clone $getid3;
// Analyse
$mpeg = new getid3_mpeg($clone);
$mpeg->Analyze();
// Import from clone and destroy
$getid3->info['audio'] = $clone->info['audio'];
$getid3->info['video'] = $clone->info['video'];
$getid3->info['mpeg'] = $clone->info['mpeg'];
$getid3->info['warning'] = $clone->info['warning'];
unset($clone);
}
}
break;
default:
throw new getid3_exception('Unknown RIFF type: expecting one of (WAVE|RMP3|AVI |CDDA|AIFF|AIFC|8SVX|CDXA), found "' . $riff_sub_type . '" instead');
}
if (@$info_riff_raw['fmt ']['wFormatTag'] == 1) {
// http://www.mega-nerd.com/erikd/Blog/Windiots/dts.html
$this->fseek($getid3->info['avdataoffset'], SEEK_SET);
$bytes4 = $this->fread(4);
// DTSWAV
if (preg_match('/^\\xFF\\x1F\\x00\\xE8/s', $bytes4)) {
$info_audio_dataformat = 'dts';
} elseif (preg_match('/^\\x7F\\xFF\\x80\\x01/s', $bytes4)) {
$info_audio_dataformat = 'dts';
}
}
if (@is_array($info_riff_wave['DISP'])) {
$info_riff['comments']['title'][] = trim(substr($info_riff_wave['DISP'][count($info_riff_wave['DISP']) - 1]['data'], 4));
}
if (@is_array($info_riff_wave['INFO'])) {
getid3_riff::RIFFCommentsParse($info_riff_wave['INFO'], $info_riff['comments']);
}
if (isset($info_riff_wave['INFO']) && is_array($info_riff_wave['INFO'])) {
foreach (array('IARL' => 'archivallocation', 'IART' => 'artist', 'ICDS' => 'costumedesigner', 'ICMS' => 'commissionedby', 'ICMT' => 'comment', 'ICNT' => 'country', 'ICOP' => 'copyright', 'ICRD' => 'creationdate', 'IDIM' => 'dimensions', 'IDIT' => 'digitizationdate', 'IDPI' => 'resolution', 'IDST' => 'distributor', 'IEDT' => 'editor', 'IENG' => 'engineers', 'IFRM' => 'accountofparts', 'IGNR' => 'genre', 'IKEY' => 'keywords', 'ILGT' => 'lightness', 'ILNG' => 'language', 'IMED' => 'orignalmedium', 'IMUS' => 'composer', 'INAM' => 'title', 'IPDS' => 'productiondesigner', 'IPLT' => 'palette', 'IPRD' => 'product', 'IPRO' => 'producer', 'IPRT' => 'part', 'IRTD' => 'rating', 'ISBJ' => 'subject', 'ISFT' => 'software', 'ISGN' => 'secondarygenre', 'ISHP' => 'sharpness', 'ISRC' => 'sourcesupplier', 'ISRF' => 'digitizationsource', 'ISTD' => 'productionstudio', 'ISTR' => 'starring', 'ITCH' => 'encoded_by', 'IWEB' => 'url', 'IWRI' => 'writer') as $key => $value) {
if (isset($info_riff_wave['INFO'][$key])) {
foreach ($info_riff_wave['INFO'][$key] as $comment_id => $comment_data) {
if (trim($comment_data['data']) != '') {
$info_riff['comments'][$value][] = trim($comment_data['data']);
}
}
}
}
}
if (empty($info_audio['encoder']) && !empty($getid3->info['mpeg']['audio']['LAME']['short_version'])) {
$info_audio['encoder'] = $getid3->info['mpeg']['audio']['LAME']['short_version'];
}
if (!isset($getid3->info['playtime_seconds'])) {
$getid3->info['playtime_seconds'] = 0;
}
if (isset($info_riff_raw['avih']['dwTotalFrames']) && isset($info_riff_raw['avih']['dwMicroSecPerFrame'])) {
$getid3->info['playtime_seconds'] = $info_riff_raw['avih']['dwTotalFrames'] * ($info_riff_raw['avih']['dwMicroSecPerFrame'] / 1000000);
}
if ($getid3->info['playtime_seconds'] > 0) {
if (isset($info_riff_audio) && isset($info_riff_video)) {
if (!isset($getid3->info['bitrate'])) {
$getid3->info['bitrate'] = ($info_avdataend - $info_avdataoffset) / $getid3->info['playtime_seconds'] * 8;
}
} elseif (isset($info_riff_audio) && !isset($info_riff_video)) {
if (!isset($info_audio['bitrate'])) {
$info_audio['bitrate'] = ($info_avdataend - $info_avdataoffset) / $getid3->info['playtime_seconds'] * 8;
}
} elseif (!isset($info_riff_audio) && isset($info_riff_video)) {
if (!isset($info_video['bitrate'])) {