Replay Gain: A how to informational


 

Replay Gain implementation for Sansa Fuze


What is it?

Replay Gain is a method for keeping the perceived volume level constant during playback of diverse content.  Typically, Albums are mixed and targeted to differing average volume levels.  During playback in shuffle mode there can be wide differences in the track output volume, causing the user to make frequent corrections to the volume level.

Sansa Fuze’s Replay Gain is a method whereby average volume playback level is kept consistent automatically.

The difference in the volume level vs. a reference (typically 89dB) is stored in the track metadata fields and is used by the Sansa Fuze to adjust the volume control to produce a uniform level.  It should be noted that our implementation does not modify the actual music samples.  It extracts the level adjustment in decibels (dB) from track metadata and applies an adjustment to the output volume control.

Software on the user’s computer analyzes the tracks to produce the Replay Gain values for embedding in the metadata.  The Sansa Fuze implementation follows the 2001 proposed Replay Gain standard which is detailed at: 

http://www.replaygain.org/

More information on ReplayGain can be found on Wikipedia at:

http://en.wikipedia.org/wiki/Replay_Gain

The Sansa Fuze’s implementation was tested to work for all of its supported non-DRM formats (MP3, WMA, OGG, FLAC) using MediaMonkey.  MediaMonkey is a free media manager application which can be downloaded at: 

http://www.mediamonkey.com/

Replay Gain for DRM Protected tracks (ie Rhapsody / Napster/ Netlibrary/ Audible) as well as SanDisk SlotRadio content is not supported. 

The subscription sites may apply their own track leveling.

SanDisk SlotRadio content has been volume leveled in advance at a reference of 89 dB.

How do I use Replay Gain?

On your Computer:
First you need to analyze the tracks in your library.  Download the MediaMonkey software and add your Music collection to the Manager. 

Configure the MediaMonkey “Volume Leveling” options under Tools>Options>Volume Leveling.  You can specify to also analyze the Album volume (otherwise known as “Audiophile Volume” ) when doing the Track Analysis. “Album volume” computes an average correction for all the tracks that comprise an album. Album Gain is supported by the Fuze as well as the Track Gain method.

Select your music files and then select “Tools> Analyze Volume”. This will perform the volume level analysis based on the options you have set up.  It will write the Replay Gain values to the ID3 tag for MP3, Vorbis Comments for OGG or FLAC, or WMA header for WMA content.  This action can take a long time depending on the size of your collection.   It’s best to run the program overnight to do a large collection.  You do not need to “Level Track Volume” which will apply the correction to MP3 files’ data.

Note:  Fuze does not support APEv2 tags used by MP3Gain.

On the Player:
Once your files have been analyzed you can transfer them to the Fuze Player.
To enable/ disable Replay Gain: select Music Options>Replay Gain.  Select the Mode to be “Song”, “Album”, or “Off”.  The Off setting will not apply any corrections to the volume level regardless of the Replay Gain values found. If Album mode is selected but Album Gain values are not present, Track Gain values will be used if available.

There is a “ Pre-Gain ” setting which allows you to adjust the overall Playback Volume level upward to compensate for the “average” level of your library’s track adjustment.  For example, if your collection is mainly classical or soft songs, you should use a Pre-Gain of 0 dB, since the average level is likely to be close to 89 dB.  For Hard Rock / Hip Hop collections, the Replay Gain values will be more negative, (meaning the song is above the 89dB target) like -8 dB. In this case, higher Pre-Gain level such as 4.5 dB can be used. You can compensate the overall gain level upward in 1.5 db steps up to a maximum of +12 db.  Pre-Gain is NOT applied to tracks that have no Replay Gain values available. Pre Gain is helpful for matching Replay Gain adjusted content with Rhapsody or Napster Protected Content that may be both present on the player.

Line Out mode:
Replay Gain adjustment in Fuze’s Line Out (or Docked) mode is supported. The maximum total positive line-out adjustment is 4.5 dB, limited by the hardware.  In Line Out mode it’s recommended to set the Pre-Gain to “0db” to allow headroom for the adjustment.

Viewing the Replay Gain values on the Fuze:
You can conveniently view the Replay Gain values for your currently playing track by accessing the Music options (down arrow) and scrolling to the second page of the “ Track Info ” screen.  If there is no Replay Gain value present these items will not be shown

Message Edited by slotmonsta on 04-08-2009 05:13 PM

@slotmonsta wrote:

 

 

Note:  Fuze does not support APEv2 tags used by MP3Gain.

 

It used to. Are you saying you took this out?

I must say, thanks!  The difference with this feature is great.

Is there any way to scan and apply ReplayGain to songs already on the player?  Or do I need to re-transfer my music?  (I’m using MTP mode.)

Switch to MSC mode, pull in the files into Media Monkey  and click tools/Analyse Volume… thats all

@tapeworm wrote:


@slotmonsta wrote:

 

 

Note:  Fuze does not support APEv2 tags used by MP3Gain.

 


It used to. Are you saying you took this out?

I don’t believe the Fuze actually ever did support APEv2 tags, it just ignored them so that if they were there they didn’t bother anything.

A while back I did a lot of looking around on the net to find out more about MP3Gain (before using it). From what I read, even though it says it does not alter the actual music in the MP3 file it does alter the information for each block header to tell the player what level to play the block at (if the player actually pays attention to the block header info for level). It also adds other MP3 tags, as well as the APEv2 tags (for players that can make use of those instead).

As long as the proper stuff MP3Gain changed/added is in an MP3 file it can also reverse the process by reseting the block headers and removing the additional extra tags.

Anyway, that’s how it all sounded like it worked from what I had read. So, as long at the Fuze read the block header data to control each blocks volume the APEv2 tags should not have been needed and were just ignored.

 Now, if the above is true, I really do not understand the need for the ReplayGain feature in the latest Fuze firmware as far as MP3 playback goes. However, it may be usefull for the other file types (that MP3Gain does not work with).

I don’t remember where I read about MP3Gain changing the block data now anymore. May have been on Wikipedia. Anyway, do some Googling and see if you (eventually) come up with what I mentioned above and let the rest know more here. I’m going to bed now, otherwise I’d hunt around for the info myself.

Once you analyze your library of music and add the replay gain information to the MP3 files ID3 tags you never need to add the extra step of applying MP3 gain to the files on the player.  Some folks did not want to touch their original files for whatever reason.

Agreed that of course MP3Gain works for MP3 files before the update.

There was no clear way to do volume leveling for FLAC files for example. Lossless audio is bit for bit accurate. Now you can have consistent volume for FLAC files played back on Fuze.

Cheers ,

SansaFix

I have about 850 songs in my Fuze. Could anyone tell me, how long the process will take time if I analyze all of them by using media monkey?

@timn wrote:
Switch to MSC mode, pull in the files into Media Monkey  and click tools/Analyse Volume… thats all

Just one problem with that: when you switch to MSC mode, the files that you transferred in MTP mode do not appear.

No matter, I figured out a way to solve the problem.  I used winamp to copy all of my songs back to my harddrive.  I’m applying replay gain now, and I’ll just add them back to my player again.

I think I’m going to switch to MSC mode after this, though.  Seems to be much easier to work with.

…Note:  Fuze does not support APEv2 tags used by MP3Gain…

This is true and false…

It’s true that the Fuze won’t support the APEv2 tags used by MP3Gain, but the APEv2 tags are what MP3Gain uses to note the analysis and undo information only.  MP3Gain actually modifies the “global gain” on each frame of the MP3 file.  As a result, players that don’t support normal Replay Gain, will see obvious Gain improvements with MP3Gain.  I have used MP3Gain on all my MP3’s and have noted SIGNIFICANT differences in gain from files that were not modified by MP3Gain and files that were.  Every Sansa I have owned noted Gain changes on files modified with MP3Gain.

Replay Gain does NOT modify the “global gain” of each frame, and as a result, a player supporting Replay Gain is required for you to notice gain changes made by Replay Gain.

Since the Sansa Fuze does not support the APEv2 tags used by MP3Gain, turning on or off Replay Gain on the Fuze will have absolutely no affect on playback in the Fuze.  However if you use MP3Gain to modify an MP3 file then the gain increase or decrease you applied via MP3Gain will definitely be noticable when played back on the Fuze, even with Replay Gain off.

Many people prefer Replay Gain because all the Gain adjustments are made in the tag.  Thus the actual file is not changed.   The danger of using MP3Gain is that if for some reason, the APEv2 data is lost of the file, then you lose the ability to undo your gain changes, and now your MP3 is “stuck” at the gain it was at prior to losing the tags. CORRECTION:  If the APEv2 tags somehow do lose their “data” you simply need to run MP3Gain again, and it will re-analyze the track and rewrite the data as the current Db level.  You can then lower the gain down to a lower value.  However, if you don’t know what the original DB level of the track was, then you are simply lowering it back to a new value, not necessarily it’s original value. 

With Replay Gain, there is no modification of the global Gain values in the MP3 frames.  As a result, if you lose the metadata, you lose nothing.  It’s safer.  Another advantage is that you can easily switch between album and track gain on the player, thus if you are in shuffle, you can choose track gain, but if you are playing an album, you can choose album gain, just change how you want Replay Gain to use a different gain.  This is why some people prefer Replay Gain over MP3Gain, the frames are never touched and you can choose choose gain type on the fly.  With Mp3Gain, you are stuck on the type of gain you used when you modified the file using Mp3Gain.  Replay Gain is more versatile, and does not modify your files.  The downside is your player MUST support Replay Gain to get any benefit at all.

I prefer MP3Gain, as I don’t have to worry whether or not my player will support it or not.  I can play my MP3 through any application and my Gain changes will be read.  Since I backup all my music regularly, then I don’t feel too worried about losing the metadata, since I can always delete the corrupt file and restore from the backup.

Hope this clarifies things.

Message Edited by p_opus on 04-09-2009 06:51 PM

Message Edited by p_opus on 04-09-2009 07:00 PM

@p_opus wrote:

…Note:  Fuze does not support APEv2 tags used by MP3Gain…

 

This is true and false…

 

It’s true that the Fuze won’t support the APEv2 tags used by MP3Gain, but the APEv2 tags are what MP3Gain uses to note the analysis and undo information only.  MP3Gain actually modifies the “global gain” on each frame of the MP3 file.  As a result, players that don’t support normal Replay Gain, will see obvious Gain improvements with MP3Gain.  I have used MP3Gain on all my MP3’s and have noted SIGNIFICANT differences in gain from files that were not modified by MP3Gain and files that were.  Every Sansa I have owned noted Gain changes on files modified with MP3Gain.

 

Replay Gain does NOT modify the “global gain” of each frame, and as a result, a player supporting Replay Gain is required for you to notice gain changes made by Replay Gain.

 

Since the Sansa Fuze does not support the APEv2 tags used by MP3Gain, turning on or off Replay Gain on the Fuze will have absolutely no affect on playback in the Fuze.  However if you use MP3Gain to modify an MP3 file then the gain increase or decrease you applied via MP3Gain will definitely be noticable when played back on the Fuze, even with Replay Gain off.

 

Many people prefer Replay Gain because all the Gain adjustments are made in the tag.  Thus the actual file is not changed.   The danger of using MP3Gain is that if for some reason, the APEv2 data is lost of the file, then you lose the ability to undo your gain changes, and now your MP3 is “stuck” at the gain it was at prior to losing the tags.  Now, if you “remember” the original values, you can re-run MP3Gain and undo your changes.  But there is a small risk that in case of metatag corruption you might be “stuck” at the new gain value.

 

With Replay Gain, there is no modification of the global Gain values in the MP3 frames.  As a result, if you lose the metadata, you lose nothing.  It’s safer.  The downside is, your player MUST support Replay Gain to get any benefit at all.

 

I prefer MP3Gain, as I don’t have to worry whether or not my player will support it or not.  I can play my MP3 through any application and my Gain changes will be read.  Since I backup all my music regularly, then I don’t feel too worried about losing the metadata, since I can always delete the corrupt file and restore from the backup.

 

Hope this clarifies things.

That’s exactly what I was (rather poorly) trying to explain in my previous post. It was late and I needed to get to bed so I had just done a rush job at trying to get something posted to give people a little insight into things. I was hoping someone else would come along provide a better explaination than I had time to. You did a GREAT job of clearifying what I was trying to point out earlier. Thank you p_opus!!!

Thank you to both of you for your salient explanations.  I’ve used MP3Gain (over Replay Gain) for its universality for many years, and the above explanations provide the underlying technological reasons which I knew but didn’t fully understand. 

I should also point out that no one has been working on or updating MP3Gain since the beginning of 2005. As such, at some point, the various changes it makes to the MP3 files and additional tags may now longer work correctly or may cause other problems with playing while playing the files. The reason MP3Gain may (eventually) no longer be of any use is because of the on-going changes to the ID3 tag specifications.

As more and more players start using the newer ID3 tag specs, there is a chance that they may no longer be fully backwards compatible with the way MP3Gain was designed to do things (way back in 2005 with an older and now outdated ID3 tag spec).

On the other hand though, the people behind Replay Gain are still continuing to work and update their stuff to keep up with the ID3 tag spec changes. So, Replay Gain stands a much better chance of remaining funtional in the future.

Things are now changing far to rapidly with all forms of technology these days. So, what worked yesterday may no longer work tomorrow. It’s getting really hard to keep up with everything and it’s difficult to keep everthing updated to the newest, latest, greatest, whatever.

@miltst wrote:

I should also point out that no one has been working on or updating MP3Gain since the beginning of 2005.  

 

 

On the other hand though, the people behind Replay Gain are still continuing to work and update their stuff to keep up with the ID3 tag spec changes. So, Replay Gain stands a much better chance of remaining funtional in the future.

 

well which one is it? and what are your sources?  

@drlucky wrote:


@miltst wrote:

I should also point out that no one has been working on or updating MP3Gain since the beginning of 2005.  

 

 

On the other hand though, the people behind Replay Gain are still continuing to work and update their stuff to keep up with the ID3 tag spec changes. So, Replay Gain stands a much better chance of remaining funtional in the future.


 

well which one is it? and what are your sources?  

 

My comments are just an opinion and pure speculation on my part.

Many companies have added Replay Gain support to their music management and ripping software. Likewise, many portable player manufacturers have been including support for it as well (just like Sandisk added support for it in the latest Fuze firmware upgrade). It also appears that the people involved with changes to the ID3 Tag specification seem to be leaving more options to allow Replay Gain than they are for MP3Gain.

Rather than relying on my speculation about things, I’d recommend you do some Google searches for MP3Gain, Replay Gain, and ID3 Tags and then decide for yourself which one is likely to continue to work in the future. At this point in time they both work. If they both will continue to do work, or if one wins out over the other in the future still remains to be seen.

Just as a side note… MP3Gain only works with MP3 files, while Replay Gain can be used with many other file types like FLAC or OGG (if your music management or ripping software has Replay Gain sound leveling support built in or if it can be added as a a plug-in).

(Edited to add comment about additional file types)

Message Edited by miltst on 04-10-2009 05:14 AM

I am not worried about the future of MP3Gain.  Almost all the players now ignore APEv2 tags, which is fine, since the gain information is not stored there.  Like I said before the Gain adjustment is made to the actual “global” gain settings in each frame of the MP3 itself.  Regardless of changes in the ID3tag specification, the actual “playback” mechanism for MP3’s will not change.  So as long as MP3Gain can write the APEv2 tags and read them to make their adjustment, changes in the ID3 Tag standard should not affect this.

Several years ago, players did attempt to read the APEv2 tags which would cause corrupted data to be displayed for “album/track/etc”.  Mp3Gain even has the option to not write the APEv2 tags, or remove them on existing files.  Now this does eliminate your ability to automatically “undo” your Gain changes, and you would have to manually track the original Gain of the file.  But since all the current players ignore the APEv2 tag, it’s more an more a non issue.

What it comes down to is simply this.

1.  Do you want to adjust Gain for multiple file formats?  Use Replay Gain

2.  Do you want to be able to change between album gain and song gain on the fly on your player?  Use Replay Gain

3.  Do you want to make sure that there are no actual changes to the actual MP3 file, original file?  Use Replay Gain

4.  Do you want to make sure that your gain adjustments can be read and played back on ANY device capable of playing MP3’s?  Use MP3Gain.

To much thought for me!!  I’ll leave it off for now and it is nice to know it’s there for future use should I want or have to use it…  I may just be going to MP3’s at 256kbps and be calling it good!!  Still In the thought proses though!!  George

Suggestion:

Use Media Monkey and rip CDs to FLAC (or MP3) format and have it automatically analyse the track volume in the process.  Then you wont need to go back and analyze all the tracks later should you decide to use it.

Message Edited by sansafix on 04-10-2009 08:49 AM

I use & prefer Media Jukebox.  Replay Gain will only work with Media Monkey? 

@rickh wrote:
I use & prefer Media Jukebox.  Replay Gain will only work with Media Monkey? 

Not sure about Media Jukebox, but most of the big players support replaygain these days.  Winamp has had it for years.