本文整理汇总了PHP中getid3_riff::FixedPoint16_16方法的典型用法代码示例。如果您正苦于以下问题:PHP getid3_riff::FixedPoint16_16方法的具体用法?PHP getid3_riff::FixedPoint16_16怎么用?PHP getid3_riff::FixedPoint16_16使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类getid3_riff
的用法示例。
在下文中一共展示了getid3_riff::FixedPoint16_16方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Analyze
//.........这里部分代码省略.........
$offset += 2;
$comment_length = getid3_lib::BigEndian2Int(substr($info_riff[$riff_sub_type]['COMT'][0]['data'], $offset, 2));
$offset += 2;
$getid3->info['comments_raw'][$i]['comment'] = substr($info_riff[$riff_sub_type]['COMT'][0]['data'], $offset, $comment_length);
$offset += $comment_length;
$getid3->info['comments_raw'][$i]['timestamp_unix'] = getid3_riff::DateMac2Unix($getid3->info['comments_raw'][$i]['timestamp']);
$info_riff['comments']['comment'][] = $getid3->info['comments_raw'][$i]['comment'];
}
}
foreach (array('NAME' => 'title', 'author' => 'artist', '(c) ' => 'copyright', 'ANNO' => 'comment') as $key => $value) {
if (isset($info_riff[$riff_sub_type][$key][0]['data'])) {
$info_riff['comments'][$value][] = $info_riff[$riff_sub_type][$key][0]['data'];
}
}
break;
case '8SVX':
$info_audio['bitrate_mode'] = 'cbr';
$info_audio_dataformat = '8svx';
$info_audio['bits_per_sample'] = 8;
$info_audio['channels'] = 1;
// overridden below, if need be
$getid3->info['mime_type'] = 'audio/x-aiff';
if (isset($info_riff[$riff_sub_type]['BODY'][0]['offset'])) {
$info_avdataoffset = $info_riff[$riff_sub_type]['BODY'][0]['offset'] + 8;
$info_avdataend = $info_avdataoffset + $info_riff[$riff_sub_type]['BODY'][0]['size'];
if ($info_avdataend > $getid3->info['filesize']) {
$getid3->warning('Probable truncated AIFF file: expecting ' . $info_riff[$riff_sub_type]['BODY'][0]['size'] . ' bytes of audio data, only ' . ($getid3->info['filesize'] - $info_avdataoffset) . ' bytes found');
}
}
if (isset($info_riff[$riff_sub_type]['VHDR'][0]['offset'])) {
// shortcut
$info_riff_riff_sub_type_vhdr_0 =& $info_riff[$riff_sub_type]['VHDR'][0];
getid3_lib::ReadSequence('BigEndian2Int', $info_riff_riff_sub_type_vhdr_0, $info_riff_riff_sub_type_vhdr_0['data'], 0, array('oneShotHiSamples' => 4, 'repeatHiSamples' => 4, 'samplesPerHiCycle' => 4, 'samplesPerSec' => 2, 'ctOctave' => 1, 'sCompression' => 1, 'Volume' => -4));
$info_riff_riff_sub_type_vhdr_0['Volume'] = getid3_riff::FixedPoint16_16($info_riff_riff_sub_type_vhdr_0['Volume']);
$info_audio['sample_rate'] = $info_riff_riff_sub_type_vhdr_0['samplesPerSec'];
switch ($info_riff_riff_sub_type_vhdr_0['sCompression']) {
case 0:
$info_audio['codec'] = 'Pulse Code Modulation (PCM)';
$info_audio['lossless'] = true;
$actual_bits_per_sample = 8;
break;
case 1:
$info_audio['codec'] = 'Fibonacci-delta encoding';
$info_audio['lossless'] = false;
$actual_bits_per_sample = 4;
break;
default:
$getid3->warning('Unexpected sCompression value in 8SVX.VHDR chunk - expecting 0 or 1, found "' . sCompression . '"');
break;
}
}
if (isset($info_riff[$riff_sub_type]['CHAN'][0]['data'])) {
$ChannelsIndex = getid3_lib::BigEndian2Int(substr($info_riff[$riff_sub_type]['CHAN'][0]['data'], 0, 4));
switch ($ChannelsIndex) {
case 6:
// Stereo
$info_audio['channels'] = 2;
break;
case 2:
// Left channel only
// Left channel only
case 4:
// Right channel only
$info_audio['channels'] = 1;
break;
default: