writing specific ID3v2.3 tags

Post Reply
aaron_storm
User
Posts: 5
Joined: Sat Jan 31, 2009 1:00 am

writing specific ID3v2.3 tags

Post by aaron_storm » Sat Jan 31, 2009 2:37 am

Hi,

I am looking to know the proper identification to write the following ID3v2.3 tags. I've got most of them work, but I need help with the last 3.

field - tag in array structure - var to be set
title - title - $TagData['title'][]
artist - artist - $TagData['artist'][]
album - album - $TagData['album'][]
album artist - band - $TagData['band'][]
composer - composer - $TagData['composer'][]
genre - genre - $TagData['genre'][]
comments - comments - $TagData['comment'][]
tracknumber (track number/track count) - track_number - $TagData['track'][]
year - year - $TagData['year'][]
discnumber (disc number/disc count) - part_of_a_set? - ?
part of compilation - ? - ?
grouping - description? - ?


I have tried using the following fields according to Mp3tag (they match the other fields), but they didn't work.
disc number is called 'discnumber'
part of compilation is called 'itunescompilation'
grouping is called 'contentgroup'

Any pointers would be appriciated. Thanks!

James Heinrich
getID3() v1 developer
Posts: 1475
Joined: Fri May 04, 2001 4:00 pm
Are you a spambot?: no
Location: Northern Ontario, Canada
Contact:

Re: writing specific ID3v2.3 tags

Post by James Heinrich » Sat Jan 31, 2009 1:14 pm

Supported ID3v2 frames are listed in module.tag.id3v2.php::FrameNameShortLookup() (around lines 2900-3100).
Can you PM/email me (a link to) a sample file that has these 3 fields in the ID3v2 tag so I can make sure getID3 supports them.

aaron_storm
User
Posts: 5
Joined: Sat Jan 31, 2009 1:00 am

Re: writing specific ID3v2.3 tags

Post by aaron_storm » Sat Jan 31, 2009 6:16 pm

Hi James,

Thanks for the quick reply with a link to a sample mp3. I have sent you a PM (hope you get it since they are showing in my outbox;not sent box).

I am still learning about those short frame names.

Thanks,
Aaron

James Heinrich
getID3() v1 developer
Posts: 1475
Joined: Fri May 04, 2001 4:00 pm
Are you a spambot?: no
Location: Northern Ontario, Canada
Contact:

Re: writing specific ID3v2.3 tags

Post by James Heinrich » Sat Jan 31, 2009 8:30 pm

iTunes uses non-standard (oh, wow, what suprise...) ID3v2 frames for their part-of-a-compilation tags ("TCP" for ID3v2.2 and "TCMP" for ID3v2.3). getID3() should nevertheless handle them fairly well by simply adding them into the lookup tables in FrameNameLongLookup() and FrameNameShortLookup(). Attached is an updated version of module.tag.id3v2.php
Attachments
module.tag.id3v2.php
(119.49 KiB) Downloaded 880 times

aaron_storm
User
Posts: 5
Joined: Sat Jan 31, 2009 1:00 am

Re: writing specific ID3v2.3 tags

Post by aaron_storm » Sun Feb 01, 2009 10:08 pm

James,

Thanks for the update! I was able to do everything that I wanted with little modification.

Update:
- module.tag.id3v2.php (per the one provided by James. update: 2 lines to add TCP and TCMP frame support)
- write.id3v2.php (to add support on writing the above frame. See below)

write.id3v2.php
(line 1928) $ID3v2ShortFrameNameLookup[2]['itunescompilation'] = 'TCP';
(line 1995) $ID3v2ShortFrameNameLookup[3]['itunescompilation'] = 'TCMP';

and I also modify
$ID3v2ShortFrameNameLookup[3]['part_of_set'] = 'TPOS';
to
$ID3v2ShortFrameNameLookup[3]['part_of_a_set'] = 'TPOS';

The reason is so the name 'part_of_a_set' matches the field when you browse via demo.browse.php. That difference threw me a bit when I was looking to find out what field name to use. I was close; I was using 'part_of_a_set' per what I see on demo.browse.php, but the write.id3v2.php uses a different field ('part_of_set'). Now I know and will check the write.id3v2.php for correct field name.

Once the above modification were made, I was able do set all the tags I wanted.

In Summary:

['artist'][]
['title'][]
['composer'][]
['album'][]
['band'][]
['year'][]
['comment'][]
['genre'][]
['track'][] or ['tracknumber'][]
['part_of_a_set'][] or ['part_of_set'][] if you haven't modified write.id3v2.php
['content_group_description'][]
['itunescompilation'][]


Thanks a lot James!

James Heinrich
getID3() v1 developer
Posts: 1475
Joined: Fri May 04, 2001 4:00 pm
Are you a spambot?: no
Location: Northern Ontario, Canada
Contact:

Re: writing specific ID3v2.3 tags

Post by James Heinrich » Sun Mar 08, 2009 5:39 pm

aaron_storm wrote:$ID3v2ShortFrameNameLookup[2]['itunescompilation'] = 'TCP';
$ID3v2ShortFrameNameLookup[3]['itunescompilation'] = 'TCMP';
=> $ID3v2ShortFrameNameLookup[3]['part_of_a_set'] = 'TPOS';
The above change will be included in v1.7.8b5, thanks.

frr
User
Posts: 1
Joined: Sun Jun 21, 2009 8:06 pm
Are you a spambot?: no

Re: writing specific ID3v2.3 tags

Post by frr » Sun Jun 21, 2009 8:10 pm

Hi, I have a similiar question, on which the solution above does not seem to work. Instead of iTunes "part of set" field, I'd like to write to Media Monkey's "Custom Field" fields. I think the closest thing I found regarding the frames is "COMMENT Songs-DB_Custom1" for custom field 1. This seems a bit odd however compared to the other 4 or 5 letter combinations in the frame lookups. As expected, this (using the rest of the steps mentioned above) doesn't work. Is it possible to write to these custom fields? Thanks

Post Reply