Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- A file whose RIFF size is still the streaming placeholder 0xFFFFFFFF reports no duration: its frame counts were never filled in.
- AVI INFO text honours a `CSET` chunk (code page 65001, 1252, 0 or 28591); without one, valid UTF-8 (ffmpeg's and TagLib#'s encoding) is read as UTF-8 and other text as Windows-1252. On save, an unchanged value keeps its exact bytes and the file keeps its `CSET` (or its absence); changed values are written in the file's code page when they fit it (ASCII only when there is no `CSET`), otherwise the list becomes UTF-8 with a `CSET` of code page 65001 before it. When the list becomes UTF-8, untouched text in a declared code page decoded exactly (1252, 28591, 0) is rewritten as the same text in UTF-8; a save that would have to rewrite untouched text whose code page is a guess (no `CSET`), is not decoded here (for example Shift-JIS or cp1251), or that holds a byte its declared code page leaves undefined (0x81, 0x8D, 0x8F, 0x90, 0x9D in 1252; 0x80-0x9F under code page 0) is refused, and the error names the field and which of those reasons applies. A CSET rewritten to 65001 keeps the file's country, language and dialect codes. The five undefined 1252 code points are never written as 1252 bytes; a value holding one goes to UTF-8. WAV INFO is unchanged (Latin-1).
- Limits: a save loads the whole file (about the file's size in memory when nothing moves, twice that when data moves), so AVI files of 2 GiB or more cannot be saved yet. `MediaFile.Read` and `AviFile.ReadFromFile` read only the header and tag chunks.
- Matroska `AlbumArtistSort` and `ComposerSort`: `SORT_WITH` nested in the album-level `ARTIST` (`TargetTypeValue` 50) and in `COMPOSER`, with flat `ALBUM_ARTIST_SORT` / `COMPOSER_SORT` as the fallback. Clearing removes both forms at every level the getter reads. When the track inherits the album's `ARTIST`, writing either `ArtistSort` or `AlbumArtistSort` first copies that `ARTIST` to the track level, so the other sort is kept (#116).

#### Raw AAC (ADTS/ADIF) Support
- `AacFile` reads and writes raw AAC files (`.aac`): ADTS (ISO/IEC 13818-7 §6.2, MPEG-2 and MPEG-4) and ADIF (§6.1)
Expand All @@ -86,6 +87,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Matroska: a new SeekHead entry is added only to the first SeekHead (RFC 9559 section 6.3).
- A file that starts with an ID3v2 tag followed by an ADTS or ADIF stream is now detected as `MediaFormat.Aac` instead of `MediaFormat.Mp3`, and `Mp3File.IsValidFormat` returns false for it
- APE: `ApeTagItem.Parse` and the item check that places an APEv2 tag (`ApeTagLocation`, used by WavPack, Musepack, Monkey's Audio and AAC) now share one set of item rules, and the check no longer copies each item value. The accepted tags are unchanged. The reserved-key error now names the reserved spelling ("ID3", "TAG", "OggS", "MP+"), not the key as written.
- Matroska `AlbumArtists` reads and writes a flat `ALBUM_ARTIST` (the name ffmpeg writes) when the file has one, so it pairs with that file's `ALBUM_ARTIST_SORT`; otherwise it is still the album-level `ARTIST`. Clearing it removes `ALBUM_ARTIST` and `ALBUM_ARTIST_SORT`.
- Matroska sort setters treat an empty string like null and remove the sort, the way the parent setters already do.
- Matroska fields written for the whole file (`Year`, `Comment`, `Genre`, `Genres`, `Composers` and the like) are written where their getter reads them. A value inherited from a broader target is replaced in place instead of shadowed by a copy at the track level, and a clear removes the name at every level the getter reads, so `Genre = null` no longer leaves an inherited genre showing. A new field goes beside the file's other fields, not into a Tag that holds only `ARTIST`.
- Matroska flat sorts (`ARTIST_SORT`, `ALBUM_ARTIST_SORT`, `COMPOSER_SORT`) belong to the value in their own Tag, as ffmpeg writes them. A Tag without that value passes its sort down to the value below it, and a broader Tag that repeats the same value is the same value (the tagging spec allows repeating it per track). Only a broader Tag with a different value keeps its own sort apart. A set leaves one copy, in the value's Tag; a clear removes every copy of that value's sort; a cleared value takes the sorts of its own Tag and of the value-less broader Tags above it, unless an equal value below still reads them, and a broader Tag that repeats it keeps its own; and a value placed between another value and its sort moves that sort down to the value it sorts. The track title, album title and album-level album artist pair their sorts over the run that starts at their level, so a value-less `ALBUM_ARTIST_SORT` at 60 or 70 is read, cleared and replaced too. A value written equal to the broader one it shadows repeats that SimpleTag with its `SORT_WITH`. Tags that target a chapter, attachment, track or edition are never read or changed by these rules.
- Matroska custom fields named `TITLE_SORT`, `ARTIST_SORT`, `ALBUM_SORT`, `ALBUM_ARTIST_SORT` or `COMPOSER_SORT` are read, written and removed through the matching sort property, so they pair with their value and see a nested `SORT_WITH`; a sort takes one value.
- Matroska setters treat writing back the value read as a no-op, so the file's bytes stay as they were; a null still clears, including a value a broader level holds behind an empty one. They follow `Tag.IsWriteBack`, checked before anything changes and against the list the getter reads: `""` or an empty list is a write-back only when no value holds text, and `CopyTo` makes the target hold exactly the source's value, so a copy equal to the target's first ISRC, catalog number, artist or genre replaces the rest of the list. `Publisher = null` also removes `LABEL`, and `ReplayGainTrackGain`/`ReplayGainTrackPeak` remove the older `REPLAYGAIN_GAIN`/`REPLAYGAIN_PEAK` copy on a set or clear, as their getters read those names.

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ See the [Migration Guide](docs/MIGRATION-FROM-TAGLIB.md) for detailed comparison
- **Multi-Target**: Supports .NET Standard 2.0/2.1, .NET 8.0, and .NET 10.0
- **Format Support**:
- Audio: MP3 (ID3v1/ID3v2), FLAC, Ogg Vorbis, Ogg Opus, Ogg FLAC, WAV (RIFF INFO/ID3v2), AIFF (ID3v2), MP4/M4A (AAC/ALAC), raw AAC (ADTS/ADIF, ID3v2/APEv2/ID3v1), ASF/WMA, DSF (DSD), DFF (DSDIFF), WavPack, Monkey's Audio (.ape), Musepack
- Matroska/WebM (`.mkv`, `.mka`, `.mks`, `.mk3d`, `.webm`): tags, chapters (editions and nested chapter atoms), duration, audio and video properties, tracks, and pictures. Tag values, chapters, pictures, and each track's enabled flag can be saved. A disabled track is not picked as the main audio or video track. Pictures are image attachments: a new front cover is written as `cover.jpg` or `cover.png` (another image type keeps its own extension, such as `cover.gif`), and fonts and other attachments are kept. WebM has no attachments, so a save that would add a picture to a WebM file fails.
- Matroska/WebM (`.mkv`, `.mka`, `.mks`, `.mk3d`, `.webm`): tags (including `SORT_WITH` sort names for title, artist, album, album artist, and composer), chapters (editions and nested chapter atoms), duration, audio and video properties, tracks, and pictures. Tag values, chapters, pictures, and each track's enabled flag can be saved. A disabled track is not picked as the main audio or video track. Pictures are image attachments: a new front cover is written as `cover.jpg` or `cover.png` (another image type keeps its own extension, such as `cover.gif`), and fonts and other attachments are kept. WebM has no attachments, so a save that would add a picture to a WebM file fails.
- MPEG program streams (`.mpg`, `.mpeg`, `.mpe`, `.vob`) and MPEG video elementary streams (`.mpv`, `.m1v`, `.m2v`): duration, MPEG-1/MPEG-2 video properties, and the first audio stream (MPEG audio, AC-3, LPCM). ID3v2 in front of the stream, an ID3v2.4 tag appended after it (the layout TagLib# writes), and ID3v1 are read and written in place; the stream bytes are not changed.
- Audible `.aa`: the text dictionary (title, author, narrator, dates, descriptions, and every other key by name), the cover image, and the duration. Dictionary edits can be saved; the encrypted audio, its DRM keys, and the cover are copied unchanged. Edited files have been checked with ffprobe, ffmpeg, and ExifTool, not with Audible's own apps, which may check a digest the file stores (the purpose of the `68ec733412b9` key is unknown). Keep a copy of the original, or save to a new path. Audible `.aax` is MPEG-4 and opens as MP4/M4A, with its audiobook atoms (narrator, short and parent titles, product IDs, release date) as named properties. Decryption is out of scope.
- AVI (`.avi`, including OpenDML): RIFF INFO and `ID32` (ID3v2) tags, duration, video size, frame rate and FourCC, and the first audio stream. Tags are saved without changing the `movi` sample data; every `idx1` and OpenDML index stays valid. INFO text follows the RIFF `CSET` chunk (ISO 8859-1 when there is none): 65001, 1252, 0 and 28591 are decoded, and with no `CSET` valid UTF-8 (what ffmpeg and TagLib# write) is read as UTF-8 and other text as Windows-1252. On save, a value you did not change keeps its exact bytes and the file keeps its `CSET`; changed values are written in the file's code page when they fit it (with no `CSET`, ASCII only), otherwise the list becomes UTF-8 with a `CSET` of code page 65001 before it, which ffprobe, TagLib# and exiftool read (mediainfo ignores `CSET`). When the list becomes UTF-8, untouched text in a declared code page that is decoded exactly (1252, 28591, 0) is rewritten as the same text in UTF-8; the save is refused, with an error naming the field and the reason, when an untouched value's code page is only a guess (no `CSET`), is not decoded here (Shift-JIS, cp1251, ...), or the value holds a byte its declared code page leaves undefined (0x81, 0x8D, 0x8F, 0x90, 0x9D in 1252; 0x80-0x9F under code page 0). The new `CSET` keeps the old one's country, language and dialect codes. The five undefined 1252 code points are written as UTF-8, never as 1252 bytes. A save loads the whole file into memory (about one file's worth when nothing moves, two when the data has to move), so AVI files of 2 GiB or more cannot be saved yet; reading has no such limit.
Expand Down
Loading
Loading