Welcome Guest ( Log In | Register )

> foobar2000 Tech Support Forum Rules

Please read foobar2000 Tech Support Forum Rules before posting and comply with all the points.
Failure to provide all the information pointed out in the above document in your post is considered wasting other people's time and in extreme cases will lead to your topic getting locked without a reply.

See also: Hydrogenaudio Terms of Service.

Reply to this topicStart new topic
Converting ReplayGain'ed files, Questions about the resulting files...
post Nov 17 2003, 14:54
Post #1

Group: Members
Posts: 37
Joined: 16-July 03
From: Turkey
Member No.: 7821

I have my albums in encoded in FLAC. I will soon add ReplayGain info to them and store them on an external HDD. When I need to burn them to CD for the iMP player, I'll encode them to MP3 or Vorbis using the diskwriter.

What I want to understand: is there any difference between
  • just transcoding the ReplayGained FLAC using diskwriter (having the "use replaygain" option checked in settings)
  • transcoding a with without ReplayGain info and adding the info later.
I guessed there shouldn't be, but I did the following experient:
I made two identical files, one with replaygain and one without.
I encoded both with the "use replaygain" both ticked and not ticked (in cfg)
The result is four files (I know I did some extra unnecessary work but it was to be sure). Three of them are identical (those without RG). The file with RG info is significantly smaller (a few KiB's). The bitrate of that file is 1 less than the others (VBR file average). I'm worried because this may show a quality loss that I haven't noticed.

The reason for my preference of gaining the lossless instead of lossy files is that I won't have to do that for lossy files separately then.

Are files made with the first option same or similar to Mp3gain'ed files (compatible with anything)?

Another question: If I convert a ReplayGain'ed FLAC file from the command line, (oggenc with flac input support), will the resulting file have RG automatically? This would be a much preferred method because my real platforum is GNU. I have to use foobar2000 because I currently use single file per album (maybe I'll change).
Go to the top of the page
+Quote Post
post Nov 17 2003, 15:08
Post #2

Group: Developer
Posts: 501
Joined: 22-January 03
From: Netherlands
Member No.: 4684

There shouldn't be any audible difference between the two files.

Are files made with the first option same or similar to Mp3gain'ed files (compatible with anything)?

The files that you've encoded with replaygain enabled are of course going to have the same volume on all players, so I suggest that you stick to that method. In theory, there might be a very small loss of quality. In practice, I strongly doubt that anybody can notice it.
Go to the top of the page
+Quote Post
post Nov 17 2003, 15:27
Post #3

Group: Members (Donating)
Posts: 681
Joined: 10-December 01
From: Belgium
Member No.: 622

What you're seeing (a smaller file) is perfectly normal, and this is also the method I use.

When you have a FLAC file with replaygain info, and use the CLI encoder with "use replaygain" checked, the replaygain value will be applied when decoding the file. So basically the result is similar to applying Wavegain to the temporary WAV file before encoding to MP3 or Ogg Vorbis.

Here is an interesting thread about this process:

Make sure you understand that, when "use replaygain" is checked, it will not copy the replaygain values to the resulting file, but it will apply the replaygain value, thus making the temporary WAV file louder or quieter before encoding.

Considering the high volumes that are used in mastering nowadays, the WAV file will in almost all cases be quieter.

Therefor, when you play the resulting MP3 or Ogg Vorbis files in a player that has no replaygain support, the file that's created with "use replaygain" enabled will probably sound quieter than the others.

I actually like the way it works, because the resulting file will automatically play at the desired volume level, regardless of what player you use (whether it supports replaygain or not).

Also, since quieter music needs less bytes during encoding, the resulting file will be smaller. This is what you are seeing.

The only disadvantage this method has compared to using e.g. MP3Gain is the fact that the volume change is non-reversable. However, since you keep the original FLAC file, you could always easily recreate the MP3 or Ogg Vorbis file without replaygain if you want.

This post has been edited by PoisonDan: Nov 17 2003, 15:29

Over thinking, over analyzing separates the body from the mind.
Go to the top of the page
+Quote Post
post Nov 17 2003, 21:14
Post #4

Group: Members
Posts: 37
Joined: 16-July 03
From: Turkey
Member No.: 7821

Thank you both for answering. What you said is exactly as what I wished the case to be (making the temporary WAV file louder or quieter before encoding). For my last question (encoding without fb2k) I guess the answer is that ReplayGain info is discarded so I'll have to gain again (not a big problem).
Go to the top of the page
+Quote Post
post Nov 18 2003, 16:03
Post #5

ReplayGain developer

Group: Developer
Posts: 5645
Joined: 5-November 01
From: Yorkshire, UK
Member No.: 409

It would make sense to carry the replay gain values (suitably modified) to the final file, at least for lossless files...

e.g. if the FLAC file had RG track = -8dB, RG album = -7dB, and you applied the album gain upon decoding, then the resulting file should logically have RG track = -1dB, RG album = 0dB. You could calculate the appropriate peak values too, and (if a common convention could be figured out) you could store the adjustment that had been made, so you could restore the tracks to the original loudness if required. (e.g. RG adjust = -7dB or something).

If you make lossy copies, then the true RG values may be slightly different. However, it's better to have "nearly" values than none at all. This is one reason I suggested storing the RG calculation method along with the RG data, but this has been largely ignored.

The peak values will be wrong after lossy encoding, but these could easily be calculated if required.

At the very least, when transcoding lossless>lossless with RG change, it could/should be possible to pass and convert the RG values, accounting for any pre-amp.

Just an idea.

Go to the top of the page
+Quote Post
post Feb 4 2004, 20:12
Post #6

Group: Members
Posts: 601
Joined: 19-July 02
From: USA
Member No.: 2667

Whose code or what process is being used in foobar2000 for the Diskwriter "use replaygain" option? As was discussed in the aforementioned thread a while back, the best process would be to use an encoder's built-in scaling option if possible, not that one could tell the difference between this and a WavGain as such, but I am guessing that the latter is what foobar2000 is currently using. Thanks

Edit: Also, about 2Bdecided's idea, has this been implemented anywhere?

This post has been edited by mmortal03: Feb 4 2004, 20:14

WARNING: Changing of advanced parameters might degrade sound quality. Modify them only if you are expirienced in audio compression!
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


RSS Lo-Fi Version Time is now: 30th August 2015 - 07:43