Media & Communications

What is mutagen (audio file tags)

What it is

A Python library for reading and writing audio tags: artist, album, cover art and, for FLAC, the real bit depth.

Where it is used

Wherever a program sorts or names music files: it reads the tags and the real format parameters instead of trusting the file name.

Where it helps a business

When files enter a library or catalogue automatically, and their description (artist, album, cover art, quality) must be the truth rather than what the source promised.

How it works

ffprobe reads a file's parameters, but for FLAC it often reports the container's 32 bits instead of the real 24. mutagen refines the actual bit depth. The file name can then be built from measured parameters, for example Artist - Title [24bit-192kHz].flac, and a verification line with bit depth, sample rate, bitrate and cut-off frequency is written into the tags.

Common problems

  • Numbers in the name contradict the contents. A release can be labelled 24/192 while it contains a CD master. That is why the name and tags come from measurements only.

When you do not need it

If files never enter a catalogue and nobody searches them by tags, separate tag handling is unnecessary.

โ† All terms

Need a website, a bot or automation?

Terms explained โ€” now let's get to work: tell us about the task and we'll turn it into a clear work plan.