Replay This

So, after some trial-and-error, I’ve cracked the RVA2 frame format as written by Quod Libet / Mutagen.

  • All values are stored big-endian (most significant byte first).  This tripped me up, because this is not true for all data stored in all tag formats.
  • If we think of the peak value in terms of the “units, tens, thousands” format you learned at school (only, of course, in binary this is “units, twos, fours”), the first bit is the units, the second is the halves, the third quarters and so on.  Simple, yes?  However, it’s not so easy to infer from the code that parses it.  So I’ve put plenty of comments in the amarokcollectionscanner code.
  • Everything else you could wish to know about the format is in the ID3v2.4 frames list, section 4.11.

So Amarok’s collection now has complete support for replay gain tags in Ogg Vorbis (as written by vorbisgain), FLAC (as written by flacenc) and MP3 (as written by Foobar2000 [ID3v2.3 TXXX comments], Quod Libet / Mutagen [ID3v2.4 RVA2] or mp3gain [APEv2]).

Other formats will follow.  As will replay gain support for files that aren’t in the collection, but are on the local machine.


Tags: , ,

6 Responses to “Replay This”

  1. finto Says:

    great work!! thank you

  2. Paulo Dias Says:

    This is great news, another missing feature crossed off my list 🙂
    I’ using amarok compiled today (svn 912659) , can you tell me how i can check if replaygain i working? (since the volume slider doesnt change).

    Also, a amarok script (with necessary replay gain client detection) which would apply replay gain tags would be great 🙂

    keep up the good work, amarok 2.0 is getting better and better.

  3. Rasi Says:

    i am impressed… great work!

  4. randomguy3 Says:

    @Paulo Dias: If you turn on debug output (run amarok as `amarok –debug`), you will get a message on the console every time the track changes telling you how much gain was applied.

  5. Stuart Neill Says:

    Thank you very much. Lack of replay-gain support was my #1 reason for not moving to Amarok2.

  6. Paulo Dias Says:

    I indeed run amarok in debug mode and the gain shows up 🙂 very nice.
    Now, to close the wrap, a welcome feature would be a script/code to apply replay gain automatically when building/processing the collection.

    A script would be awesome, i remember i used one with amarok 1.x to do just that.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: