當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。