Neil Siegfried
Neil Siegfried

Reputation: 31

What is the APEv1 tag identifier?

I've been cleaning up my MP3 collection and mass deleted all the ID3v1.x/ID3v2.x tags from my collection using taglib-sharp so I can use one program to re-tag them automatically. Anyway, I need to be able to remove APEv1 and APEv2 tags if their are any in the files. They're rarely used with MP3 but can be.

I need to know what the tag identifier is for APEv1, which is located at the end of the file. I've searched the web and found nothing.

As a side note, with APEv2, the tag identifier is 'APETAGEX' and is located at the beginning of the file.

Thanks.

Upvotes: 2

Views: 258

Answers (2)

Brian Nickel
Brian Nickel

Reputation: 27550

According to the APEv1 spec, the only difference between APEv1 and APEv2 is that APEv1 doesn't have a header and as such must always be at the end of a file or immediately before the ID3v1 tag.

The footer/header is 32 bytes long and starts with APETAGEX, so checking for the presence of an APE tag at the end of a file would involve reading 8 bytes at Length - 32 and checking for that ASCII string, or Length - 32 - 128 if there's an ID3v1 tag (or an entirely different position if there are footer APEv2 and ID3v2 tags in the file since there's really no strict precedent in that case).

That said, taglib-sharp should be able to remove footer APEv1 tags with file.RemoveTags(TagTypes.Ape)

Upvotes: 2

Jens Meinecke
Jens Meinecke

Reputation: 2940

According to APE tag - Wikipedia there is no actual tag, but the data is appended to the end of the file.

APEv1

The APEv1 tag was designed for the Monkey's Audio format.[2] In MP3 files, the APE tag is stored at the very end of the file, with no inline declaration in the body of the file. The software handles the writing and access to the tag and does not interfere with the contents of the MP3.

Upvotes: 0

Related Questions