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

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
Swede78
Forum Contributor
Posts: 198
Joined: Wed Mar 12, 2003 12:52 pm
Location: IL

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

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Are you sure you want to edit the comment stored in Windows and not actually in the file itself?
Swede78
Forum Contributor
Posts: 198
Joined: Wed Mar 12, 2003 12:52 pm
Location: IL

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

viewtopic.php?t=42788 may be of interest.
Swede78
Forum Contributor
Posts: 198
Joined: Wed Mar 12, 2003 12:52 pm
Location: IL

Post 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.
Swede78
Forum Contributor
Posts: 198
Joined: Wed Mar 12, 2003 12:52 pm
Location: IL

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Windows pulls data from both ID3v1 and ID3v2 fields.
Swede78
Forum Contributor
Posts: 198
Joined: Wed Mar 12, 2003 12:52 pm
Location: IL

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

http://getid3.sourceforge.net/ bottom of the page.

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