Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Understanding Foobar 2000's Replay Gain (Read 20740 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Understanding Foobar 2000's Replay Gain

Using Win XP SP3 and Foobar2000 V1.2.3

I'm compiling a set of bedtime music files (FLAC) for my great-niece. Because her player does not play MP3s, I plan to burn a couple of standard CDs for her. I certainly don't want her to be suddenly jolted awake at 3am and then hate me for the rest of her life.

So I've been reading about the Replay Gain feature in Foobar2000. What confuses me in the Foobar manual is that it smooths out the audio level "... without physically changing the file itself".

That leads me to believe only certain players can read the replaygain values. If that's the case, then it seems to me the smoothing will be lost when I burn the CDs.

I must be missing or misunderstanding some key information. Can anyone shed some light on this for me?

Thanks
EdP

Understanding Foobar 2000's Replay Gain

Reply #1
You can write the data to the files as well.
And when you convert you can choose to apply ReplayGain.

http://eolindel.free.fr/foobar0.9/Replaygain.php [ Foobar2000 Manual - Replaygain ]
Windows 10 Pro x64 // foobar2000 1.3.10

Understanding Foobar 2000's Replay Gain

Reply #2
What confuses me in the Foobar manual is that it smooths out the audio level "... without physically changing the file itself".
The default method of ReplayGain changes the file in the sense of adding tag fields defining the alterations required to bring the file to a defined average perceived loudness. It doesn’t change the audio.

Quote
That leads me to believe only certain players can read the replaygain values.
Correct.

Quote
If that's the case, then it seems to me the smoothing will be lost when I burn the CDs.
Only correct if the same method is used, but there are other options possible. Example: as implied by Andreasvb, files can be created in which the volume adjustment is applied into the audio itself. These could then be written to CD. Or, for MP3s, there is MP3gain, which losslessly/reversibly alters the MP3 data in a widely compatible way (albeit only to the nearest 1.5 dB).

For everything else, I can only really recommend searching for information, as there is a lot out there. Hydrogenaudio itself, in addition to many discussions, hosts many original documents for ReplayGain; the official specification is still hosted here and in the past had a subdomain all of its own.

Finally, note that foobar2000 since v1.1.6 estimates average loudness using a different and presumably more accurate algorithm: EBU R128. In terms of applying and using the resulting ‘RG’ data, the processes are the same, but be aware that mechanistic explanations you read in older documents will not be directly equivalent to what foobar2000 does now.

Understanding Foobar 2000's Replay Gain

Reply #3
Good info in the previous replies. I hope nobody minds another.

I'm compiling a set of bedtime music files (FLAC) ...
... I plan to burn a couple of standard CDs ...
... it seems to me the smoothing will be lost when I burn the CDs.

It depends on your process / how you burn the CDs.

If you run a ReplayGain scan of the FLAC files, the gain info will be written as metadata/tags to the file. So, yes, only software/hardware that supports ReplayGain can apply the gain adjustments.

If you use a burning application which supports FLAC importing and ReplayGain processing, such as CDBurnerXP (link), then the FLAC files would be ready to burn as-is.

If you use burning software which does not support FLAC and ReplayGain, and you will be converting to WAV before burning, then you can use the "Processing" section of foobar2000's converter (link) to apply the ReplayGain adjustment during the FLAC to WAV conversion. Of course, you can use any other software to convert as long it supports ReplayGain.

 

Understanding Foobar 2000's Replay Gain

Reply #4
Thank you all for responding so quickly and thoroughly.

To test the procedure, I copied a few files to a new folder and followed your suggestions using Foobar to scan and update the replaygain tags (single album)

The only way to write the data to the files in Foobar is to convert them. They're already in FLAC format, but I selected FLAC as the output format anyway.
Because I wanted to keep the same file names, I selected %filename% and sent the output to a different folder.
In the ReplayGain section of the Processing sheet, I selected "apply gain".

I have to assume the RG data is now part of the new file because I don't know if a file's properties sheet (using MP3Tag & Foobar) is showing tags or embedded data.

Comments or suggestions welcomed.

EdP

Understanding Foobar 2000's Replay Gain

Reply #5
Two ways to test:
(1) Scan converted files for RG and check whether the computed adjustments written to the tags are consistently 0. (Needless to say, you can delete the tags afterwards.)
(2) Disable ReplayGain and listen for differences in volume between original and converted files.

Edit:
I have to assume the RG data is now part of the new file because I don't know if a file's properties sheet (using MP3Tag & Foobar) is showing tags or embedded data.
You can’t show embedded data. The only equivalence to “embedded data” is that the volume adjustment is done in the audio itself before it is written to the destination file. It’s not written as tags or anything else. (MP3gain is the exception, but that’s obviously not relevant to FLAC.)

Understanding Foobar 2000's Replay Gain

Reply #6
Understanding of foobar's ReplayGain... Yes, this is something that I need. After so many years of listening to the music on PC I decided that I should try it. I scanned about 1,5k of my Beatport, Juno and Trackitdown files. After scanning and updating file tags I noticed that volume of track that was recently played has dropped down. So I think that it works, but I noticed strange thing. Where are those tags? I can't see them on any file, even after forced reload of metadata. Other thing is that in Preferences I can set "Show warning when applying RaplayGain to MP3 data". And it is checked. About 1/3 of scanned files were mp3 files. I got no warning...
Summarizing:
1. Where are my RG tags? Why I can't see them?
2. Why I wasn't warned about mp3 files?

EDIT:
And point no. 3:
3. Can I scan file twice - one time for "per-track gain" and second for album gain and save both values? I was thinking about listening to the music in various order modes (random/default) and ReplayGain Override plugin... It looks like it simply needs 2 separate values to work?

Understanding Foobar 2000's Replay Gain

Reply #7
1. Check the Properties tab, not Metadata.
2. It only warns you if you apply the RG to the MP3 data, that is. Not the tags, the actual audio data itself.
Windows 10 Pro x64 // foobar2000 1.3.10

Understanding Foobar 2000's Replay Gain

Reply #8
And point no. 3:
3. Can I scan file twice - one time for "per-track gain" and second for album gain and save both values? I was thinking about listening to the music in various order modes (random/default) and ReplayGain Override plugin... It looks like it simply needs 2 separate values to work?

When you scan files as albums, both track and album gain values are calculated and saved, so you don't need to scan twice.

Understanding Foobar 2000's Replay Gain

Reply #9
Thx yanni and Andreasvb

Understanding Foobar 2000's Replay Gain

Reply #10
Hmmm... I got one more question. What will foobar do when I set "Source mode" to "album" , "Processing" to "apply gain and prevent clipping", but file will be missing album gain and album peak? Does foobar use "track" values instead or just play files as with "Source mode" set to "none" and thus volume will suddenly change?

Understanding Foobar 2000's Replay Gain

Reply #11
It will take Album if it has, else Track.
Windows 10 Pro x64 // foobar2000 1.3.10

Understanding Foobar 2000's Replay Gain

Reply #12
I got new question
Here it is:
I scanned my whole library. While I was analyzing playlists it turned out, that some tracks from few albums, that were already RG scanned have copies in other directories, with slightly different tags. So I decided that in this case I will rescan them again, with option "scan selection as a single album". That were just copies of the files from albums, with unmodified audio content. But here is some strange thing. After rescan Album Gain values has changed. Only slightly (like +/- 0,24 dB) but they changed. My question is why? Is it possible that there is a bug in foobar's RG engine?

Same thing was noticed when I scanned long flac file, and later .cue file that was referencing to this flac. Album Gain calculated for just .flac file was for example 0,05 dB lower than calculated for .cue file that is referencing to exactly the same .flac. Why? I know that these differences are inaudible, but it still seems strange to me.

Understanding Foobar 2000's Replay Gain

Reply #13
Album gain is a function of the other tracks, if any, that are RG scanned at the same time as part of the "album".

Understanding Foobar 2000's Replay Gain

Reply #14
It did what you asked it to, scan all files as same album.
Either choose all files from the album and choose same option, or select every file and choose scan by tags/folder.

I use either scan per-file or by tags, have hidden the other options.
Windows 10 Pro x64 // foobar2000 1.3.10

Understanding Foobar 2000's Replay Gain

Reply #15
I understand that it did what I was asking for, I know that. But I can't understand why album gain is changing when I simply copied tracks from the same album and make them appear in playlist twice? All audio properties remain the same - album peak should be the same, tracks peaks should be the same. I thought that if album peak remains unchanged, then the amount of volume change should be the same. And exaple of .cue file and referenced .flac is even more obvious representation of what I expected - that's just the same audio data - one time continuous, one time chopped into parts. But maximum audio peak should remain the same. But it looks like it wasn't detected as the same... Why?

Understanding Foobar 2000's Replay Gain

Reply #16
I understand that it did what I was asking for, I know that. But I can't understand why album gain is changing when I simply copied tracks from the same album and make them appear in playlist twice? All audio properties remain the same - album peak should be the same, tracks peaks should be the same. I thought that if album peak remains unchanged, then the amount of volume change should be the same. And exaple of .cue file and referenced .flac is even more obvious representation of what I expected - that's just the same audio data - one time continuous, one time chopped into parts. But maximum audio peak should remain the same. But it looks like it wasn't detected as the same... Why?

I'm just guessing but since replay gain is calculated in blocks, the alignment of the blocks with reordered or duplicated tracks change (i.e. any track that isn't an exact multiple of the block size in length will offset the following tracks, at least that's my speculation and expectation.)  This would change the album gain result.

Understanding Foobar 2000's Replay Gain

Reply #17
>You can’t show embedded data.<

DUH ... that should have been obvious to me.
Thanks for your help.

EdP

Understanding Foobar 2000's Replay Gain

Reply #18
it seems to me the smoothing will be lost when I burn the CDs.
fb2k can burn CDs with the audio CD writer plug-in. It will happily apply ReplayGain to the audio tracks when writing them to CD. You can apply whatever DSP you want too.

Cheers,
David.

Re: Understanding Foobar 2000's Replay Gain

Reply #19
One more question on, more or less , the same topic.

If I have already permanently altered my collection to a set dB level (say 93), is there still no loss of quality to the original files if i later decide to re-run the process on all the same files and increse the volume to, say, 95 ?

(Obviously with the usual risks of clipping etc).

Thanks very much!  :)

Re: Understanding Foobar 2000's Replay Gain

Reply #20
If you use the "Apply ReplayGain to file content" method there is no quality loss. If you used Converter to re-encode the files there would be.