Commit Graph
16 Commits
Author SHA1 Message Date
Xavier Henner 05c9a3fa59 Be a little less strict on invalid frames
Add iTunes frames and ignore unknown frame only if they are too big
2015-07-12 02:02:12 +02:00
Xavier Henner 1e646522d6 Support for numeric genres in id3v2
TCON

    The 'Content type', which previously was stored as a one byte numeric value
only, is now a numeric string. You may use one or several of the types as
ID3v1.1 did or, since the category list would be impossible to maintain with
accurate and up to date categories, define your own.

    References to the ID3v1 genres can be made by, as first byte, enter "("
followed by a number from the genres list (appendix A) and ended with a ")"
character. This is optionally followed by a refinement, e.g. "(21)" or
"(4)Eurodisco". Several references can be made in the same frame, e.g.
"(51)(39)". If the refinement should begin with a "(" character it should be
replaced with "((", e.g. "((I can figure out any genre)" or "(55)((I
think...)". The following new content types is defined in ID3v2 and is
implemented in the same way as the numerig content types, e.g. "(RX)".

To test it, use the id3v2 tool

% id3v2 -g 79 test.mp3
% id3v2 -l test.mp3| grep TCON
TCON (Content type): Hard Rock (79)
% ./tag test.mp3| grep Genre
 Genre: (79)

With the patch :
% go build && ./tag test.mp3| grep Genre
 Genre: Hard Rock
2015-07-04 14:20:43 +02:00
Xavier Henner 6c5d32240b typo in comment + small correction 2015-05-25 08:57:37 +02:00
Xavier Henner a931bf6e30 Code refactorization
Should even work if the subatoms of "----" are out of order
2015-05-25 08:45:31 +02:00
Xavier Henner be3da62488 Add more tags to mp4
1) correct a bug with the mdat atom.
Sometimes, the metadata can be at the end, after the audio
Demo :
   get any music file and strip the metadata
   convert it to m4a with ffmpeg
   analyse it with MusicBrainz Picard
   et voila, you have the metadata at the end.

Example of structure of a m4a created that way;
https://www.dropbox.com/s/602yivdstan7506/atom.txt?dl=0

2) add support for the "----" tag
See http://atomicparsley.sourceforge.net/mpeg-4files.html
It gives access to the tags created by MusicBrainz Picard
2015-05-25 00:33:47 +02:00
Xavier Henner a678a5d67b Fix a bug in Sum() and add all id3frames in Raw()
The Seek in SumID3v2() didn't take into account the size of the ID3v2 Header
(10 bytes). Thus when tagging the same file with or without it's tag, there was
a discrepancy. (

And I've added a default case when parsing the id3v2 tags, by storing the
binary content to Raw()
2015-05-24 21:19:15 +02:00
Xavier Henner eef1ffcbbd Support for the UFID tag 2015-05-24 12:23:30 +10:00
Xavier Henner 45d987ac1d Support for TXXX, WXXX and generic W frames
I hacked readTextWithDescrFrame() and readTFrame() to generalize them
to other case (presence or not of a language and whether or not the
data part is encoded (URL are not)

This patch depend of 3b7a3d548500bd10afa63819a9904ac12e15cdc5 since I found the
bug while developping this patch
2015-05-24 12:23:30 +10:00
Xavier Henner f6a1e5325c Fix bug in the split method
Sometimes, we can have this configuration :

description 00 00 00 data (with delim = [00 00])
with splitN, we make the separation at the first 00 00 :
[description, 00 data]

But in fact, we must make the separation one byte later
[description 00, data]
2015-05-24 12:23:30 +10:00
Xavier Henner 0f62dc116a Add support for lyrics.
Not supported in id3v1 and id3v22
2015-05-19 22:06:16 +10:00
Xavier Henner 0ae35897fa Typo, forgotten debug string and a missing comment 2015-05-18 09:56:47 +02:00
Xavier Henner 7fac753a70 Add support for lyrics.
Not supported in id3v1 and id3v22
2015-05-18 09:32:54 +02:00
Xavier Henner cac0ed8f57 now work with 'ff 00 ff 00' in the file 2015-05-01 00:55:17 +02:00
Xavier Henner dad1548722 Need to skip Unsynchronisation byte at the boundary between 2 Read 2015-04-30 22:07:08 +02:00
Xavier Henner 1480876144 can have multiple frames with the same name. append a number from the second one 2015-04-26 17:55:59 +02:00
Xavier Henner c1716d5521 take into account h.Unsynchronisation and add some sanity check 2015-04-26 16:56:26 +02:00