In MP3s, TXXX fields are always case insensitive
- Dominant language
- Python
- Stars
- 120
- Forks
- 41
- PR merge metrics
- No merged PRs in 30d
Description
Beets seems to write replaygain tags in upper-case regardless of changelog entry 1.3.2 (https://beets.readthedocs.io/en/stable/changelog.html#december-22-2013)
There are music player in the wild which only understand lower-case ReplayGain tags (Poweramp, KODI),
Using an actual version of a of Beets I can only find upper-case ReplayGain tags in my tagged files with a hex editor.
How I reproduced it:
First of all I download a clean WAV file from bandcamp.com for example. I convert the WAV file to a mp3 via Foobar using the Lame mp3 encoder. After that this mp3 goes into Picard. This goes through processing by Beets. For this I use a Docker Beets version (https://hub.docker.com/r/linuxserver/beets). After that I get a mp3 file including replay gain tags: 03 - New Light.mp3
[03.-.New.Light.zip](https://github.com/beetbox/mediafile/files/9762218/03.-.New.Light.zip)
Using a hex editor I only find upper-case ReplayGain tags in the header of the file.

I tried `beet write` (files have not changed) and `beet write -f` (files have changed) but the mp3 files still only have upper-case ReplayGain tags.
I also tried: I have completely deleted the ReplayGain tags from a series of files with `zero` and checked that they are really gone in the library (`info`) and the mp3 files. After that I re-tagged them with replaygain (`replaygain`). After that I found the ReplayGain tags again, only in upper-case.
I changed the lines of code in mediafile.py (https://github.com/beetbox/mediafile/blob/edc64145e9e96624f8a77fd3cb929891c946d4dc/mediafile.py#L2202-L2209) to see what tags are written. After applying `scrub` and `relaygain` again, I suddenly found two tags in my file, although with different names.
So when both are named differently, all of a sudden both show up. If both have the same name but are capitalized differently, they don't show up.


Contributor guide
Research direction
Start in mediafile.py at lines 2202-2209 and reproduce the reported behavior with the attached MP3 or by running the described scrub and replaygain commands. Check how differently cased TXXX names are handled; done means ReplayGain tags can retain the required casing without collapsing distinct names, verified in the resulting MP3.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- audio-video-rtc
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100