Commit Graph

105 Commits

Author SHA1 Message Date
David Howden
5b94194b29 Remove unused error parameter, and tidy up implementation. 2016-01-03 23:05:17 +11:00
David Howden
030e21e7c2 Added DefaultUTF16WithBOMByteOrder for instances where no BOM is given. 2016-01-03 23:00:45 +11:00
David Howden
5fe43c28e4 Merge pull request #17 from wader/com-ult-frames
Add COM and ULT text frames
2016-01-03 08:39:49 +11:00
Mattias Wadman
78bcb9ae28 Add COM and ULT text frames
Add COM and ULT, both have lang and enc
See http://id3.org/id3v2-00
2016-01-01 16:20:32 +01:00
David Howden
dc1f3d7b51 Merge pull request #16 from wader/all-ftyp
Parse all ftyp:s as mp4
2015-12-29 13:25:45 +11:00
Mattias Wadman
f26c1533ee Parse all ftyp:s as mp4
It seems audio only mp4 files use ftyp:s that should have video
2015-12-28 21:36:06 +01:00
David Howden
c259675f29 Use switch in place of multiple if statements. 2015-09-20 20:13:12 +10:00
David Howden
554fadb2b4 Added Sum support for FLAC 2015-09-20 20:09:42 +10:00
David Howden
549eab9b75 Merge pull request #14 from xhenner/itunes
Be a little less strict on invalid frames
2015-07-12 11:27:14 +10:00
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
David Howden
334c71001c Merge pull request #13 from xhenner/genre
Support for numeric genres in id3v2
2015-07-04 22:49:17 +10: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
David Howden
62e2154cad Fix godoc comment. 2015-07-03 23:15:16 +10:00
David Howden
78f72c23bd Added Identity to check tool. 2015-07-02 23:07:50 +10:00
David Howden
b60e529091 Add Identity function for identifying metadata/filetypes. 2015-07-02 23:07:17 +10:00
David Howden
92e6d71ddb Refactor common code to skip last 128 bytes from ReadSeeker. 2015-06-30 23:07:26 +10:00
David Howden
52902f61b8 Switch to using relative seeks only (last remaining call using SEEK_SET). 2015-06-30 23:06:50 +10:00
David Howden
00cce15102 Remove unnecessary recursion. 2015-06-30 23:05:59 +10:00
David Howden
0b455fc176 Write straight to hash function instead of buffering. 2015-06-30 08:58:55 +10:00
David Howden
6021704ba3 Seek over next_item_id instead of reading it. 2015-06-30 08:57:03 +10:00
David Howden
6d208fee69 Remove unnecessary case in SumAtoms. 2015-06-30 08:56:21 +10:00
David Howden
cc382c48de Tidy up visibility of internal-only types. 2015-06-28 12:40:49 +10:00
David Howden
6af476df94 Correctly parse ID3 2.3 and 2.4 frame flags.
Note: wasn't causing any know issues, but needed to be made consistent with the spec!
2015-06-28 12:34:42 +10:00
David Howden
bda3a1fa8b Fixed package doc comment 2015-06-28 11:25:07 +10:00
David Howden
3e7020b161 Added license and godoc to check. 2015-06-28 10:47:45 +10:00
David Howden
17f4f77bef Update README to include simple code example.
Fix small grammatical error too!
2015-06-28 10:43:57 +10:00
David Howden
a579928cb2 Add simple example and improve ReadFrom godoc. 2015-06-28 10:32:57 +10:00
David Howden
cc7e8af340 Remove unnecessary continue, and add some spacing. 2015-06-28 09:53:57 +10:00
David Howden
624837fdc1 Remove unnecessary TrimSpace for tag name. 2015-06-28 09:53:37 +10:00
David Howden
db723fecfc Check each ID3 tag is valid.
Some tag encoders like to use non-standard padding (see http://id3.org/Compliance%20Issues) which was causing "unexpected EOF" errors.  Checking that each tag has a valid name (as per the spec) seems to be the only good way around this.
2015-06-28 09:53:07 +10:00
David Howden
1b0e92375a Fix: panic on empty description in text-description frames. 2015-06-27 19:24:33 +10:00
David Howden
d3e0c4a33f Simplify MusicBrainz Info type and support more tags. 2015-06-08 11:01:32 +10:00
David Howden
c06066fd88 Updated package godoc comment. 2015-06-07 13:01:12 +10:00
David Howden
6df4e78d96 Remove non-relative Seek calls from all functions.
Previously we would seek to the beginning of the io.ReadSeeker. It is much more
flexible to assume that the caller passes the ReadSeeker in an appropriate state.
2015-06-07 12:58:58 +10:00
David Howden
7f8f21cc46 Added flag.Usage output to check tool. 2015-06-07 12:54:44 +10:00
David Howden
4d2e737694 Remove old TODO comment. 2015-06-06 16:35:44 +10:00
David Howden
ddaa43f29c Added some more godoc comments. 2015-06-06 16:35:44 +10:00
David Howden
6cd7fd8f70 Added -mbz option to tag tool to output MusicBrainz information. 2015-06-06 16:35:44 +10:00
David Howden
e7f103ff85 Improved default usage output to use flag.PrintDefaults(). 2015-06-06 16:35:44 +10:00
David Howden
9534e41d81 Added mbz subpackage for extracting MusicBrainz-specific tags.
This is a rewrite of pull request #11 which was a first attempt at this (thanks @xhenner for starting this).
2015-06-06 16:35:39 +10:00
David Howden
d03fdf9fb5 Remove debugging output 2015-05-27 18:58:35 +10:00
David Howden
36d9163868 Refactored all MP4 code to better handle custom atoms 2015-05-27 08:43:47 +10:00
David Howden
e6dce4ae2a Merge branch 'xhenner-allmp4' 2015-05-25 22:50:42 +10:00
David Howden
3f92286cdb Merge branch 'allmp4' of https://github.com/xhenner/tag into xhenner-allmp4 2015-05-25 22:36:14 +10: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
David Howden
ffefb50681 Merge pull request #9 from xhenner/allid3v2
Fix a bug in Sum() and add all id3frames in Raw()
2015-05-25 07:36:38 +10: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
David Howden
5ed21afced Added Lyrics() to README 2015-05-24 22:49:06 +10:00