Commit Graph

35 Commits

Author SHA1 Message Date
bretttolbert
0253fc576d
added genre codes 148 to 191 (winamp ext) (#103)
* added genre codes 148 to 191 (winamp ext)
* make new genres captialization consistent with existing
* removed hyphen from Indie-Rock genre
2024-01-23 08:33:51 +11:00
David Howden
53ee65d2ae be more cautious with language parsing
Relates to #76
2020-11-20 06:21:29 +11:00
David Howden
869a70545f
Check versions before using data length indicator (#66)
* id3v2: Read and use frame data length indicator

* id3v2: only use data length indicator for 2.4

Co-authored-by: Mattias Wadman <mattias.wadman@gmail.com>
2020-04-11 12:20:04 +10:00
David Howden
7e5c04fecc
move towards using uint for all sizes (#59)
* move towards using uint for all sizes
* dsf: support larger files
2019-11-22 22:50:59 +11:00
David Howden
f163d543fb id3v2: remove unused method and merge declaration 2018-04-02 08:18:11 +10:00
David Howden
3fc65dddfc id3v2: fix variable name and pre-compute genre regexp 2018-04-02 08:17:10 +10:00
Mattias Wadman
2d92c90588 Read and skip extended header bytes for 2.3 and 2.4
Fixes #21
2016-05-05 17:18:51 +02: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
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
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
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
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
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
b55f474bf9 Refactor readTFrame and added readWFrame 2015-05-24 12:23:30 +10:00
David Howden
1832dec4e7 Refactor Ufid -> UFID 2015-05-24 12:23:30 +10: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 3b7a3d5485 since I found the
bug while developping this patch
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
David Howden
c895efbcf8 Revert "Add support for lyrics." 2015-05-19 08:03:36 +10:00
Xavier Henner
7fac753a70 Add support for lyrics.
Not supported in id3v1 and id3v22
2015-05-18 09:32:54 +02:00
David Howden
0203dd6bc4 Tidy up unsynchroniser.Read some more 2015-05-03 09:58:13 +10:00
David Howden
5989e00ece Simplified unsynchroniser and added tests 2015-05-02 09:58:05 +10:00
David Howden
07ab8d2572 Fix merge conflicts 2015-05-02 09:53:58 +10: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
David Howden
de3f502e83 Improved handling of multiple tags with the same name 2015-04-27 23:11:04 +10:00
David Howden
0f6115b228 Fixed panic on tag name length < 4 2015-04-27 22:55:59 +10: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
David Howden
1fc6cacf34 Updated ReadFrom to take io.ReadSeeker 2015-04-15 00:06:32 +10:00
David Howden
9278a7ec07 Initial commit 2015-03-19 23:21:53 +11:00