Writing ID3 Tag in MP3 File

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
zimick7
Forum Newbie
Posts: 17
Joined: Mon Dec 06, 2004 2:11 pm

Writing ID3 Tag in MP3 File

Post by zimick7 »

I am looking for a way to change ID3 tag information for an MP3 file with PHP. I know there are several ways to read the tag info with PHP classes and scripts, but has anyone run into a way to write?

I would like to be able to change title, artist, etc. (including album art) with php.

base64?

Any thoughts? ideas? suggestions?
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

reinvent the wheel you should not.

do this exactly getID3 will

http://sourceforge.net/projects/getid3/
zimick7
Forum Newbie
Posts: 17
Joined: Mon Dec 06, 2004 2:11 pm

Post by zimick7 »

I had seen getID3 before, but I thought it only was able to extract (read) from an ID3 tag...

Thanks for the info... I will check it out more in depth.
User avatar
spamyboy
Forum Contributor
Posts: 266
Joined: Sun Nov 06, 2005 11:29 am
Location: Lithuania, vilnius

Post by spamyboy »

What is ID3 ?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

spamyboy wrote:What is ID3 ?
learn to use google you should. (sorry Burr, had to)

http://www.id3.org/history.html
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

zimick7 wrote:I had seen getID3 before, but I thought it only was able to extract (read) from an ID3 tag...

Thanks for the info... I will check it out more in depth.
You may want to read the readme.txt file that goes with ID3 tag :roll: :roll: :roll:

Code: Select all

// Writing tags:
require_once('getid3.php');
$getID3 = new getID3;
getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'write.php', __FILE__);
$tagwriter = new getid3_writetags;
$tagwriter->filename   = $Filename;
$tagwriter->tagformats = array('id3v2.3', 'ape');
$TagData['title'][]  = 'Song Title';
$TagData['artist'][] = 'Artist Name';
$tagwriter->tag_data = array(;
if ($tagwriter->WriteTags()) {
	echo 'success';
} else {
	echo 'failure';
}
Post Reply