MP3 and OGG tags in PHP

时光怂恿深爱的人放手 提交于 2019-12-03 20:47:57

There are also other ID3 functions in PHP just for reading: http://php.oregonstate.edu/manual/en/book.id3.php

You should try stable version of getID3(), there is this comment for beta:

v2.0.0-b5 can write only some tag formats:

ID3v1

APEtag

FLAC

Ogg

Vorbis

Lyrics3

In stable, they should be supported (if the don't lie):

Tag formats:

ID3v1 (v1.0 & v1.1)

ID3v2 (v2.2, v2.3 & v2.4)

APE tags (v1 & v2)

(Ogg) VorbisComment

Lyrics3 (v1 & v2)

with ktaglib:

$tag = new KTaglib_MPEG_File('test.mp3')->getID3v2Tag()->getFrameList();
echo "Album: " . $tag["TIT2"];
echo "Album: " . $tag["TALB"];
echo "Artist: " . $tag["TPE1"];

If you can't use the php module for the id3 tags (sometimes you can't install modules on some hostings), you can use this function:

http://www.barattalo.it/2010/02/22/reading-mp3-informations-with-php-id3-tags/

At the moment, to write vorbis tags to an ogg/vorbis file, GetId3 requires vorbiscomment installed on the server.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!