Page 1 of 1

How can I edit "Comments" attribute of a file's pr

Posted: Thu Mar 30, 2006 3:59 pm
by Swede78
I'm looking to make a script that I can easily edit the Comments field within the Summary tab of the poperties of a file. Specifically for MP3 files, if that makes a difference. I want to be able to add/edit/delete comments of already existing MP3 files using text stored in a database that I already have. I can't find any Windows utilities that do this, and I don't think there is a DOS command that can do this either. But, I only know basic DOS commands.

In the end I would like to build a script in PHP that takes the data I have and plugs it into the MP3 files that I have. I can do this manually, but it's taking too long. Any ideas?

Thanks, Swede.

Posted: Thu Mar 30, 2006 4:05 pm
by feyd
Are you sure you want to edit the comment stored in Windows and not actually in the file itself?

Posted: Thu Mar 30, 2006 4:19 pm
by Swede78
No, I want to edit the Comments stored in the files themselves. I just found a PHP function that may be what I'm looking for. Unfortunately, it's only compatable with Linux. My server is Win2003.

xattr Functions:
http://us2.php.net/manual/en/ref.xattr.php

Posted: Thu Mar 30, 2006 4:21 pm
by feyd
viewtopic.php?t=42788 may be of interest.

Posted: Thu Mar 30, 2006 4:43 pm
by Swede78
Thanks for the suggestion, Feyd. I'm aware of the ID3 tags for MP3s, and now I know that they are editable using PHP. Good to know. But, I'm more interested in the files' properties that you can get to in Windows by right-clicking the file. Also, what I'd like to do will also involve WMA files as well. I've been searching for quite some time. I'm pretty sure there is no DOS command to edit the Comments field/attribute (whatever it's called). I can see the Comments text of an MP3 file when loaded into a text editor. I tried simply editing it there, and it just screwed the file up completely.

Posted: Thu Mar 30, 2006 4:53 pm
by Swede78
Feyd... actually the ID3 tag may be what the file properties are pulling up. In the php function id3_set_tag (http://us2.php.net/manual/en/function.id3-set-tag.php), it makes it sound like the comment string can only be 30 characters. I can put a lot more in there using the Properties tab. So, I'm not sure if it's the same thing. But, I'll give it a try.

Posted: Thu Mar 30, 2006 5:01 pm
by feyd
Windows pulls data from both ID3v1 and ID3v2 fields.

Posted: Thu Mar 30, 2006 5:27 pm
by Swede78
Great, I think that function might do the trick. Now my problem is installing it on a Windows machine. I would need to compile php myself, and that's beyond me. I'll keep looking into this. Sourceforge has their own ID3 function called getID3, but it seems to only extract the information, not set it.

Posted: Thu Mar 30, 2006 5:30 pm
by feyd
http://getid3.sourceforge.net/ bottom of the page.

The thread I linked you to was linked to the getID3 project page. :P