Skip to content

Add option to write DR14 values to audio file metadata #2

Description

@nixternal

Add ability to write calculated DR values back to audio file tags/metadata. This would allow music players and library managers to display DR values alongside other metadata (artist, album, etc.).

Use case: Users want to see DR values in their music player without re-analyzing files each time. Writing to tags makes the information persistent and portable.

Implementation notes:

  • Use mutagen library (already a dependency)
  • Add CLI flag: --tag or --write-tags
  • Write to appropriate tag fields:
    • DYNAMIC RANGE or DR custom tag
    • REPLAYGAIN_ALBUM_RANGE (existing standard)
  • Support major formats: FLAC, MP3, M4A, OGG
  • Should be opt-in (don't modify files by default)
  • Add --dry-run option to preview what would be written

Acceptance criteria:

  • --tag flag writes DR to file metadata
  • Works for FLAC, MP3, M4A, OGG formats
  • Doesn't crash or corrupt files
  • Respects existing tags (doesn't overwrite unrelated metadata)
  • Documentation updated with examples
  • Tests for tag writing and reading
  • Warning/confirmation before modifying files

Security considerations:

  • Always work on copies or have clear warnings
  • Validate file integrity after writing
  • Handle read-only files gracefully

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions