HydrogenAudio

Lossless Audio Compression => FLAC => Topic started by: oppo on 2013-02-09 16:58:16

Title: FLAC volume gain with foobar2000
Post by: oppo on 2013-02-09 16:58:16
Hello Guys!

I'm new in this FLAC thing, and wanted to try out. I ripped my audio cds with dbpoweramp (absolutely uncompressed) and use replay gain with foobar.
Maybe i've done this gain thing wrong, or correctly, but I'm not sure if it's worked or not.
I use mp3gain for my mp3 files and it works like a charm. When I was testing I used the same player and the same song in mp3 and flac format (gained with mp3gain and foobar). I listened the beginning of the songs and the mp3 version was louder (and that's the volume what I want).

Is mp3gain ruins the quality or it uses the replay gain thing?
Is there any software like mp3gain for FLAC where I can tell the exact dB value what I want? (In mp3gain I use 96,2 dB)
Title: FLAC volume gain with foobar2000
Post by: Garf on 2013-02-09 17:45:03
ReplayGain just adds tags to the files and the player infers from that what volume adjustment it needs to do.

Using mp3gain changes the actual audio date, and the reference level you use is way above what it normally is, so obviously you're not going to have the same volume.

If the player you're using supports ReplayGain, you can change the reference level in the advanced foobar2000 settings (IIRC). But if it does that, why not use the correct ReplayGain reference level for the MP3s to begin with?
Title: FLAC volume gain with foobar2000
Post by: oppo on 2013-02-09 18:28:36
First of all, thank you for your fast reply 
The second thing: sorry if I ask things that somebody already answered. (because my english is not so good)

So replay gain uses a tag only.
I always use windows media player with flac plugin, sometimes winamp (but I don't like it.)
On my phone I use PlayerPro (or Apollo) but I don't know that if these programs use replay gain tag. (They can play flac that's the only thing I know)
You wrote me a solution but I think I don't understand it all.
Do you mean if I change the reference level global in foobar I can gain my mp3 and flac files using only replay gain? (And if this correct, how, where can i do this in the program?)
Title: FLAC volume gain with foobar2000
Post by: db1989 on 2013-02-09 18:29:58
Using mp3gain changes the actual audio date
But that is reversible. Just don’t trash the metadata that it uses to store the ‘undo’ info.
Title: FLAC volume gain with foobar2000
Post by: carpman on 2013-02-09 19:00:29
oppo

This is what I'd do:

Add your FLAC files to foobar2000
Right click > Replay Gain > Choose relevant option
[The FLAC files now have Track + Album gain data]
Then convert to MP3:
Right click FLAC files > Convert > ...
Under the converter preferences there's a processing option (have a look at that and you'll see you can apply the Replay Gain to the output MP3 files)
This will mean your non-pc players (portable devices etc.) don't need replay gain as all your MP3s will be encoded at the replay gained level.

C.
Title: FLAC volume gain with foobar2000
Post by: db1989 on 2013-02-09 19:24:51
Another possible reason for different volumes between ReplayGained FLAC and MP3gained MP3 (besides the differing reference level initially) is that MP3gain is confined to increments of 1.5 dB, so adjustments must be rounded up or down to the nearest such point.

Still, if you want a simple and reversible way to level existing MP3s, without having to re-rip/-encode, it’s a great option.
Title: FLAC volume gain with foobar2000
Post by: oppo on 2013-02-10 22:51:36
I made a screenshot about my mp3gain program, I marked two buttons what I always use: https://www.dropbox.com/s/4kmqe4igah166c8/mp3gain.png (https://www.dropbox.com/s/4kmqe4igah166c8/mp3gain.png)
This is the FLAC file: https://www.dropbox.com/s/7ztv13v8zvka3bw/0...ute%20Zero.flac (https://www.dropbox.com/s/7ztv13v8zvka3bw/02.%20Absolute%20Zero.flac)
This is the mp3 file: https://www.dropbox.com/s/fs0omf2ixf6j78f/0...lute%20Zero.mp3 (https://www.dropbox.com/s/fs0omf2ixf6j78f/02.%20Absolute%20Zero.mp3)

I tested again (i didn't do anything with these files since I made this topic (eg. volume gain)) the files, in foobar I don't really hear anything, but on my phone I hear the difference that one of the two files is quieter.

I didn't find where to change the reference level in foobar. I want to rip my cds to FLAC and i don't know how to get 96,2 dB for all the files in the future.
Title: FLAC volume gain with foobar2000
Post by: db1989 on 2013-02-10 23:21:16
I didn't find where to change the reference level in foobar. I want to rip my cds to FLAC and i don't know how to get 96,2 dB for all the files in the future.
Results from searching Google for foobar2000 ReplayGain reference:
http://hydrogenaudio.org/forums/?showtopic=84265#entry726785 (http://hydrogenaudio.org/forums/?showtopic=84265#entry726785) (procedure)
http://hydrogenaudio.org/forums/?showtopic=67823#entry603381 (http://hydrogenaudio.org/forums/?showtopic=67823#entry603381) (discussion)
Title: FLAC volume gain with foobar2000
Post by: oppo on 2013-02-11 14:30:30
Thank you db1989!

So the discussion is that it's totally useless to change the reference level in foobar. (It's useful if i use mp3gain to change the volume for non replay gain players. I thought mp3gain use replay gain)
There is a phrase: "If the target reference level doesn't meet your needs, that's what the pre-amp is for (or the volume knob"

Is this phrase says i should use the pre-amp if i listen music in foobar?
Title: FLAC volume gain with foobar2000
Post by: tpijag on 2013-02-11 14:39:04
You use your choice of program to scan your music and determine the level of replay gain needed to attempt to normalize sound levels across your files.

mp3 gain does use replay gain. It takes that replay gain information and rewrites your files for use with programs that can not read a gain tag and make the adjustment on their own.  Foobar2000 can do the same thing or it can simply not rewrite your files and store the replay gain information in tags.
Title: FLAC volume gain with foobar2000
Post by: oppo on 2013-02-11 15:17:53
So it's a good way to use mp3gain for my mp3files (i don't want to change it if i don't have to)
In foobar I changed the reference level to what i use in mp3gain (96 dB)

This is the method what I did: https://www.dropbox.com/s/50r4vn8u0jzjqb4/01.jpg (https://www.dropbox.com/s/50r4vn8u0jzjqb4/01.jpg)

And now finally i have the same volume for my FLAC files and mp3 files? And if I perceive a volume difference from now that means the player where i'm listening is not supporting replay gain?
Title: FLAC volume gain with foobar2000
Post by: greynol on 2013-02-11 15:45:59
So the discussion is that it's totally useless to change the reference level in foobar. (It's useful if i use mp3gain to change the volume for non replay gain players. I thought mp3gain use replay gain)

I use a non-RG player but want to use RG and like to use a different referevce level.  I used to use mp3gain but no longer bother because I don't care about incompatible metadata or reversibility.  I also prefer not to use an altogether inefficient solution that wastes cycles due to a slow decoder.  I now  scale prior to encoding to lossy.

If I were to do this with foobar2000 then changing the reference level would hardly be useless.

Forgetting about encoding, if I typically listened to music that required a lower RG value to avoid clipping and used foobar2000 as my player, I would also change the reference; perhaps by -6dB as RG was initially designed.
Title: FLAC volume gain with foobar2000
Post by: [JAZ] on 2013-02-11 19:25:06
Let's see if we can get this right at last: (Oppo: This answers more than what you ask, but you should find your answer as well. Also, find one last comment at the end).

- Replaygain algorithm: Algorithm to find the perceived loudness of a signal (approximatedly).
- Replaygain tag: A metadata written to a file that includes information of the loudness of the signal, as per Replaygain specification, which is set relative to 89dB SPL. (In the very beginning it was 83dB, but soon the standard become 89)
- MP3Gain: A program that uses the replaygain algorithm to modify a part of an MP3 file so that its volume is altered according to the calculated loudness. The program allows to specify the target SPL. (Defaults to 89dB SPL, as per replaygain specification). This modification is reversible, and does not imply transcoding.
- Replaygain aware player: Player that understands the replaygain tag, and applies the gain while playing. Some of these players allows to alter the target SPL of playback for replaygained (and some also for non-replaygained) files.


foobar2000 is a replaygain aware player that allows setting the playback gain of files from the Playback option of the Preferences dialog.
The player also has the ability to apply the gain directly to MP3 files, like MP3Gain does, which is found in the popup menu: Replaygain->Apply track/album gain to MP3 data. An option to change the target gain when doing so can be found in the Preferences dialog, in Advanced->Tools->Replaygain Scanner


If using a replaygain aware player, it will play the MP3Gained file according to the tag, not according to altered MP3 volume, so it will sound at the same loudness than another file just tagged with replaygain.

If using a non-replaygain aware player, the files altered with MP3Gain (or the equivalent foobar2000 popup menu) will play at the altered volume, which files tagged with replaygain will play at their original volume.
Since MP3Gain can only be applied to MP3 (and AAC/MP4), other formats cannot use this technique, so they need to be modified prior to be encoded.
Since the source is usually a WAVE file, wavegain can be used, or one can also use foobar2000 and its converter utility, which allows to apply replaygain while converting to the desired format (like FLAC).

Code: [Select]
         MP3Gain Replaygain
Original:  94.5    94.5
MP3Gained: 92      89 ( -5.5)
ReplAware: 89      89        (Or a different target if changed in the player, but both the same)
NonReplAw: 92      94.5



@Oppo: Now, let me warn you that your setting is not a good choice. I don't know if you associate 96.2dB with the SNR of a CD audio, but that is plain wrong.
MP3Gain, as i've said above, uses the replaygain algorithm to estimate the loudness. It is not a volume normalizer, so 96.2 does not mean "100%".
It is true that nowadays there are songs with 98, 99 or even 100+ dB SPL according to the replaygain algorithm, so with 96.2 these files get attenuated, but I am sure that there are quite some other files in your collection that are below 96.2dB, which probably are already 100% normalized, and which you are clipping them more due to your setting.

Sure, 89dB is too low for some genres, but anything above 94dB is probably too much for most genres, especially since the aim of replaygain is to have songs of different artists and albums to have the same loudness.

As such, I recommend you to revisit your strategy.


edit: Added further explanation.
Title: FLAC volume gain with foobar2000
Post by: oppo on 2013-02-16 18:42:33
I want to thank you for Everyone especially for [JAZ]!
Helped me out, everything now works like a charm! 
Solved.

P.s.: Problem solved, so how can I end this topic?