当前位置: 首页>>代码示例>>PHP>>正文


PHP getid3_riff::DateMac2Unix方法代码示例

本文整理汇总了PHP中getid3_riff::DateMac2Unix方法的典型用法代码示例。如果您正苦于以下问题:PHP getid3_riff::DateMac2Unix方法的具体用法?PHP getid3_riff::DateMac2Unix怎么用?PHP getid3_riff::DateMac2Unix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在getid3_riff的用法示例。


在下文中一共展示了getid3_riff::DateMac2Unix方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Analyze


//.........这里部分代码省略.........
                                 case 'twos':
                                     $info_riff_audio['codec_name'] = 'Two\'s Compliment Big-Endian PCM';
                                     $info_audio['lossless'] = true;
                                     break;
                                 default:
                                     break;
                             }
                             break;
                         default:
                             $info_audio['codec'] = $info_riff_audio['codec_name'];
                             $info_audio['lossless'] = false;
                             break;
                     }
                 }
                 $info_audio['channels'] = $info_riff_audio['channels'];
                 if ($info_riff_audio['bits_per_sample'] > 0) {
                     $info_audio['bits_per_sample'] = $info_riff_audio['bits_per_sample'];
                 }
                 $info_audio['sample_rate'] = $info_riff_audio['sample_rate'];
                 $getid3->info['playtime_seconds'] = $info_riff_audio['total_samples'] / $info_audio['sample_rate'];
             }
             if (isset($info_riff[$riff_sub_type]['COMT'])) {
                 $comment_count = getid3_lib::BigEndian2Int(substr($info_riff[$riff_sub_type]['COMT'][0]['data'], 0, 2));
                 $offset = 2;
                 for ($i = 0; $i < $comment_count; $i++) {
                     $getid3->info['comments_raw'][$i]['timestamp'] = getid3_lib::BigEndian2Int(substr($info_riff[$riff_sub_type]['COMT'][0]['data'], $offset, 4));
                     $offset += 4;
                     $getid3->info['comments_raw'][$i]['marker_id'] = getid3_lib::BigEndianSyncSafe2Int(substr($info_riff[$riff_sub_type]['COMT'][0]['data'], $offset, 2));
                     $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)';
开发者ID:jwlynch,项目名称:openacs.core,代码行数:67,代码来源:module.audio-video.riff.php


注:本文中的getid3_riff::DateMac2Unix方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。