write year tag

Post Reply
melino
User
Posts: 8
Joined: Tue Sep 20, 2011 11:29 pm
Are you a spambot?: no

write year tag

Post by melino » Mon Dec 05, 2016 10:08 am

I am trying to figure out how to write the year tag (e.g. 2016) for a mp3 (ID3v2.4.0).
Can getID3 write 'year' tags?

What doesn't seem to work:

Code: Select all

$TagData['year'][] = $_POST['year'];

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

Re: write year tag

Post by James Heinrich » Mon Dec 05, 2016 3:05 pm

That should be all you need.
See https://github.com/JamesHeinrich/getID3 ... .write.php for more basic example code.

melino
User
Posts: 8
Joined: Tue Sep 20, 2011 11:29 pm
Are you a spambot?: no

Re: write year tag

Post by melino » Mon Dec 05, 2016 6:18 pm

Thanks James!

First it didn't work for me, than I found out that I was passing an integer and had to convert it to a string first.

Code: Select all

'year' => array((string)$year),
Now it works.

melino
User
Posts: 8
Joined: Tue Sep 20, 2011 11:29 pm
Are you a spambot?: no

Re: write year tag

Post by melino » Mon Dec 05, 2016 8:06 pm

Correction: it wasn't the (string) that made 'year' work, it was the change from id3v2.4 to id3v2.3.

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

Re: write year tag

Post by James Heinrich » Mon Dec 05, 2016 10:53 pm

Correct. The "year" frame is not part of the ID3v2.4 spec:
http://id3.org/id3v2.4.0-changes (section "4. Deprecated ID3v2 frames")
TYER - Year
This frame is replaced by the TDRC frame, 'Recording time' [F:4.2.5].

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest