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.

How we use it

In ToshaMusic it refines the FLAC bit depth when ffprobe reports the container's 32 bits instead of the real 24. The file name and tags are built from measured parameters only.

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 we use it

In ToshaMusic, after a download ffprobe reads the 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 is built from measured parameters, for example Artist - Title [24bit-192kHz].flac, and a verification line with bit depth, sample rate, bitrate, cut-off frequency and the bot version is written into the tags.

Common problems

  • Numbers in the name contradict the contents. Streaming services label a release 24/192 while it contains a CD master. That is why the name and tags come from measurements only.
  • The requested quality does not exist. The bot says plainly in the chat that the release is available at most as 16-bit / 44.1 kHz.

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.