php | 사운드 파일의 id3v2 태그 가져오기
페이지 정보
작성자 100K5 작성일15-03-05 15:32 조회61,206회 댓글0건첨부파일
- getID3-1.9.9-20141218.zip (1.2M) 1회 다운로드 DATE : 2015-03-05 15:32:18
관련링크
- http://www.getid3.org/ 18455회 연결
본문
<? include_once $_SERVER['DOCUMENT_ROOT']."/getID3/getid3/getid3.php"; ?>
<?
// 사운드 파일 저장 위치
$folder_dir = $_SERVER['DOCUMENT_ROOT']."/upload/";
// 사운드 파일명(mp3, wav)
$file = $folder_dir."/sample.mp3";
// 사운드 메타 태그 저장 속성
$TaggingFormat = "ISO-8859-1";
$getID3 = new getID3;
$getID3->setOption(array('encoding' =>$TaggingFormat));
$ThisFileInfo = $getID3->analyze($file);
getid3_lib::CopyTagsToComments($ThisFileInfo);
// 공통
$title = iconv('EUC-KR', 'UTF-8', $ThisFileInfo['comments']['title'][0]); // 제목
$artist = iconv('EUC-KR', 'UTF-8', $ThisFileInfo['comments']['artist'][0]); // 아티스트
$bitrate = $ThisFileInfo['bitrate']; // 비트
$filesize = $ThisFileInfo['filesize']; // 파일 사이즈
$playtime_string = $ThisFileInfo['playtime_string']; // 플레이 시간
// mp3 일경우
$album = iconv('EUC-KR', 'UTF-8', $ThisFileInfo['comments']['album'][0]); // 앨범
$year = iconv('EUC-KR', 'UTF-8', $ThisFileInfo['comments']['year'][0]); // 년도(mp3)
$comment = iconv('EUC-KR', 'UTF-8', $ThisFileInfo['comments']['comment'][0]); // 설명
$track = iconv('EUC-KR', 'UTF-8', $ThisFileInfo['comments']['track'][0]); // 트랙
// wav 일경우
$creationdate = iconv('EUC-KR', 'UTF-8', $ThisFileInfo['comments']['creationdate'][0]); // 년도(wav)
echo "<br> title = ".$title;
echo "<br> artist = ".$artist;
echo "<br> album = ".$album;
echo "<br> year = ".$year;
echo "<br> comment = ".$comment;
echo "<br> track = ".$track;
echo "<br> creationdate = ".$creationdate;
echo "<br> bitrate = ".$bitrate;
echo "<br> filesize = ".$filesize;
echo "<br> playtime_string = ".$playtime_string;
echo "<br>";
print_r($ThisFileInfo). "<br/>";
// print_r($ThisFileInfo['tags']['id3v2']). "<br/>";
foreach($ThisFileInfo['comments'] as $key2=>$val2) {
echo "<br> value = [".$key2."] ". iconv('EUC-KR', 'UTF-8', $val2[0]);
}
?>
댓글목록
등록된 댓글이 없습니다.