Using MP3 rating tags

Assigning track ratings was one of the first big projects I embarked on when first building a computer music library in the late '90s. It's easy to see why for a geeky music collector: the ability to use the ratings to playlist "best of" tracks per artist or across a collection.... data heaven!

That worked well in, what I realise now was, my narrow use case. In particular I was the only "user" of my music library, and I only used one piece of software back then: Windows Media Player. Over time I realised my solution would not scale.

For starters, it turned out that not everyone agreed with my rating of every track. Astonishing! So, to support a household's listening, if these ratings were stored inside the music files, these ratings would need to be assigned per listener.

As my home music network grew in complexity it also turned out that different music players would intepret my ratings in different ways. What was five stars in one player was four stars to another, even though I'd only rated the track once!

The tools

It turns out that we have all the tools we need for rating music files. iTunes can record ratings for example, as can Windows Media Player (WMP) and other popular players.

Unfortunately, in iTunes case, this is another case of iTunes storing data on its own database, away from other applications. As such, it's another reason I would choose not to use iTunes, as it narrows my flexibility in choosing other music players.

Other players write to the music files however, and as such could, in theory (more on that later) be more flexible. For MP3s, the ID3v2.3 and later standards define a rather cutely named field Popularimeter, often referred to by the mnemonic POPM.

POPM can be defined multiple times in a music file and each POPM can contain:

Email Identifier for the user or originator of the rating.
Rating Value from 0 to 255, 255 being the "best". 0 is "unknown", 1 is the lowest rating.
Play counter A counter for the number of times the music file has been played.

Importantly, the Email field allows ratings to be disambiguated so we could have multiple different ratings for different people. We could even have different critic ratings!

As an aside, it's also interesting that the ID3 spec defines 'good' with quote marks. Different subjective definitions of good could be adopted and described by the email field. For example (for the audiophiles) accuracy. Of course, a custom tag could also be used for this.

Outside of MP3

POPM only works for ID3-tagged music files, such as MP3, WAV and so on. What about FLAC, MP4 and other popular formats?

Things begin to get murky. The accepted field names become less agreed. In the case of MP4, for which iTunes has a monopoly of influence, there's really no agreed field, so you will have to create your own custom tag.

The most common approaches are:

FLAC and other Vorbis comment users RATING[:@email] The [:@email] appears optional.
WMA WM/SharedUserRating

Here (really) be dragons

So we fixed multi-user ratings in POPM and FLACs and WMA, but what about multi-player? This is a common case in a world where people have home audio, computer based audio, head-fi, car players, phones...

The truth is, this is where it gets really complicated. In fact, so complicated that I think I'll have to deal with it in detail in a separate post.

Suffice to say: even though the rating scale of 0-255 for POPM, say, is defined, different music players scale the values so what's one star for one music player could be two stars elsewhere.

At least 0-255 is defined for POPM; nothing was defined for FLAC's RATING tag. Most players seem to be converging on a 0-100 scale, but in the past used different scales and without a guide that the values should be between, say, 0-255 means any legacy data is likely unusable.

Worst of all, WMP treats the Email field of POPM as a describer of itself, meaning there's no differentiation of different user ratings.

So in the meantime I'm trying to setup a testing rig to see how the most popular music players treat and map ratings values. Maybe we can understand some similarity to make MP3 ratings more portable than ever!

Thanks to unsplash-logorawpixel for the image above.
tags: custom tags
blog comments powered by Disqus

The Music Library Management blog

Dan Gravell

I'm Dan, the founder and programmer of bliss. I write bliss to solve my own problems with my digital music collection.