Skip to main content

Topic: Wavegain vs. MP3Gain (Read 155025 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • k.eight.a
  • [*][*][*][*]
Wavegain vs. MP3Gain
Reply #125
Quote
well if ALL you want to do is encode things with no clipping, just use --scale 0.98 on everything. Also maybe add --noclip so that LAME spits out an error whenever it detects clipping.
[a href="index.php?act=findpost&pid=249128"][{POST_SNAPBACK}][/a]


I want to add "--scale" setting only if the resulting MP3's will introduce clipping!

I've read the LAME documentation and I've never found a switch "--noclip"...
In 3.96.1 rarewares compile I've found "--clipdetect"...
So how is it to make it clear to me?

Quote
The problem is that encoders quantize stuff, so a given sample at full scale for instance might get raised (and thus clip) or might get lowered a bit (which is not an issue). You can only fix this behaviour after the fact using MP3Gain, or by just lowering things a bit before encoding. I'd say this is far preferable, since MP3Gain does things in big 1.5dB chunks. Just use --noclip to make sure 0.98 is sufficient.
[a href="index.php?act=findpost&pid=249128"][{POST_SNAPBACK}][/a]


I can tell you that I hear the difference between the original MP3 and MP3Gain modified by -1,5db lowered volume,
so I want to keep it as loud as possible but without additional clipping introduced by MP3 encoding.
You know what I mean?
Sorry for my poor English, I'm trying to get better... ;)
"The greatest trick the Devil ever pulled, was convincing the world he didn't exist."

  • Jebus
  • [*][*][*][*][*]
  • Developer
Wavegain vs. MP3Gain
Reply #126
Well then, you have to use "--preset standard --clipdetect" or whatever without any scale applied, and see if it clips. Then if it does, try 0.9999 and see it that clips. Keep refining until you find the magic maximum value that doesn't. Annoying, huh? Just use 0.98; you won't notice the volume change.

EDIT: You're right - it's --clipdetect and not --noclip. My Bad


BTW, 1.5dB is way, WAY more of a gain adjustment than 0.98. I can't remember the calculation off-hand, but 1.5dB is closer to a gain value of like 0.70.
  • Last Edit: 23 October, 2004, 04:10:29 PM by Jebus

  • k.eight.a
  • [*][*][*][*]
Wavegain vs. MP3Gain
Reply #127
Quote
Well then, you have to use "--preset standard --clipdetect" or whatever without any scale applied, and see if it clips. Then if it does, try 0.9999 and see it that clips. Keep refining until you find the magic maximum value that doesn't. Annoying, huh? Just use 0.98; you won't notice the volume change.
[a href="index.php?act=findpost&pid=249536"][{POST_SNAPBACK}][/a]


Yes, definitely it's annoying!
But I think that there's a possibility to determine the right --scale # with using WaveGain & LAME,
when you know how these programs / format work...
But that's not my case :-(

BTW: What is the shortest step in scale # ?

Quote
BTW, 1.5dB is way, WAY more of a gain adjustment than 0.98. I can't remember the calculation off-hand, but 1.5dB is closer to a gain value of like 0.70.
[a href="index.php?act=findpost&pid=249536"][{POST_SNAPBACK}][/a]


So, that's the reason I want to go by --scale max noclip!

The sad thing is, that the more educated persons do not participate to this (resurrected) discussion to help me

I believe that there's already a possibility to go the way I want...

Edit:

Quote
You're right - it's --clipdetect and not --noclip. My Bad.[a href="index.php?act=findpost&pid=249536"][{POST_SNAPBACK}][/a]


I realized that this switch is not present in 3.93.1 compile and probably the older too. But I'm still using 3.90.3 will it work?
  • Last Edit: 23 October, 2004, 04:25:37 PM by k.eight.a
Sorry for my poor English, I'm trying to get better... ;)
"The greatest trick the Devil ever pulled, was convincing the world he didn't exist."

  • Jebus
  • [*][*][*][*][*]
  • Developer
Wavegain vs. MP3Gain
Reply #128
Quote
So, that's the reason I want to go by --scale max noclip!

The sad thing is, that the more educated persons do not participate to this (resurrected) discussion to help me

I believe that there's already a possibility to go the way I want...



I already answered your question, and I know perfectly well how to answer you correctly - no need for more "educated" people here. This is my thread!

LAME applies certain quantizations based on complex psychoacoustic analysis of the source .wav, so there is no way to predict whether a given sample will be raised (and thus clipped) or lowered in volume until AFTER the encode. If there were, the lame devs would simply include a flag to use the maximum non-clipping scalefactor. As it stands, you can only tell if it is going to clip after the fact. Anyhow this is the last answer i'm going to give on the subject - you are really concerning yourself with nothing as a simple --scale 0.98 or MP3Gain will solve your problem satisfactorily.

  • k.eight.a
  • [*][*][*][*]
Wavegain vs. MP3Gain
Reply #129
OK, thank you for your reply.

The last question:
When I encode MP3 through normal --aps setting and it shows clipping, is there a way how to determine the scale to encode it once more with no-clipping?
So this way it would be needed 2 times encoding but I would get what I want...?

I think, that in a real world there are cases in which scale 0.98 isn't sufficent for no-clipping MP3, is it right?

BTW: What is the shortest step in scale # ? 0.001 or 0.01 ?
Sorry for my poor English, I'm trying to get better... ;)
"The greatest trick the Devil ever pulled, was convincing the world he didn't exist."

  • Jebus
  • [*][*][*][*][*]
  • Developer
Wavegain vs. MP3Gain
Reply #130
nope. I'd say try 0.98, cause that will probably work, then 0.99 and if that works then 0.995 and so on

4 significant decimal places... 0.XXXX

Seriously though dude, try to ABX 0.98 from no scale at all... impossible. Sound pressure level has to almost double for a preceptible change in volume.
  • Last Edit: 23 October, 2004, 06:05:03 PM by Jebus

  • k.eight.a
  • [*][*][*][*]
Wavegain vs. MP3Gain
Reply #131
Once again, thanks a lot!

I'm curious can I use a command line:

--alt-preset standard --clipdetect --scale 0.98

Does it matter in which sequence are the switches in the command line?
Does the additonal switches break the --aps command line?

Another thing is that in the documentation of 3.90.3 compile there's no "--clipdetect" switch...
Sorry for my poor English, I'm trying to get better... ;)
"The greatest trick the Devil ever pulled, was convincing the world he didn't exist."

  • Jebus
  • [*][*][*][*][*]
  • Developer
Wavegain vs. MP3Gain
Reply #132
No it doesn't matter, and use 3.96.1 if you want that feature.

  • Jebus
  • [*][*][*][*][*]
  • Developer
Wavegain vs. MP3Gain
Reply #133
Just an update that anyone wanting to use this method now has a much easier way to go about it; a fully automated process run from within EAC.

All you need is this Wack bundle and EAC. Follow the simple install directions in the bundle and you're off and running. Cheers!
  • Last Edit: 21 May, 2005, 05:50:22 AM by Jebus

  • cyborg
  • [*][*]
Wavegain vs. MP3Gain
Reply #134
This might be a little bit off topic, but would it be a better idea to use wavegain to replaygain wave files before encoding them to Musepack or Vorbis? So far I have used Musepack v1.15v with these switches: --quality 6 (--xlevel)

And Vorbis (aotuv b3) with this switch: -q6

So far I have used fb2k's replaygain function and it has worked without problems.

  • Jebus
  • [*][*][*][*][*]
  • Developer
Wavegain vs. MP3Gain
Reply #135
there doesn't seem to be as much benefit as far as bitrate savings using non-mp3 encoders because of the issues described in this thread. Also, as far as I know all MPC decoders also support replaygain metatags natively, so this sort of "hard-coded" gain adjustment isn't all that beneficial. For vorbis? Not sure.

  • kindofblue
  • [*][*][*]
Wavegain vs. MP3Gain
Reply #136
Quote
Thanks for the links.  I was looking for some with "WAVEGAIN" and "SCALE" in big red letters...

I guess I must be confused.

I thought  that, when John said:

Quote
Give me a couple of days, or so, and I'll post a 3.90.3 version with APE and Cuesheet support, but optionally with a WaveGain first pass to generate Track/Album gain values for automatic use in '--scale xxx'.
[a href="index.php?act=findpost&pid=110529"][{POST_SNAPBACK}][/a]
...  this meant that LAME would call WaveGain (or maybe even that the WaveGain functionality would be built into the LAME exe).

I've looked at the readme's for both the LAME exe and WaveGain and I can't see how the information is transferred "automatically".

Maybe someone could draw me a diagram. 

Edit: I know the Modified EXE allows you to set the --scale value from an INI file - but that's no leap in itself is it?  I thought the --scale switch was part of the core LAME development.  Therefore, what I still have is two separate EXEs doing related things, but no direct link.  I think.
[a href="index.php?act=findpost&pid=249113"][{POST_SNAPBACK}][/a]


Indeed, a diagram might be useful for hopeless n00bs like myself.

I understand one can automate the whole thing with the special Wack bundle on rarewares.  But is there a way to do the process without a Wack setup?

Appreciate any help.
kindofblue
WavPack 4.31 / LAME 3.98 alpha 3 -V9 -vbr-new

  • Jebus
  • [*][*][*][*][*]
  • Developer
Wavegain vs. MP3Gain
Reply #137
It needs to be scripted somehow, unfortunately. If you don't want to use Wack (and/or are ONLY doing EAC -> wavegain -> lame) then try my LameGain script, it's really small and simple.

http://www.autobotcity.net/files/LameGain.zip

  • kindofblue
  • [*][*][*]
Wavegain vs. MP3Gain
Reply #138
Quote
It needs to be scripted somehow, unfortunately. If you don't want to use Wack (and/or are ONLY doing EAC -> wavegain -> lame) then try my LameGain script, it's really small and simple.

http://www.autobotcity.net/files/LameGain.zip
[a href="index.php?act=findpost&pid=304002"][{POST_SNAPBACK}][/a]


Great. Thanks, Jebus.  Will go and try it out.
WavPack 4.31 / LAME 3.98 alpha 3 -V9 -vbr-new

  • Synthetic Soul
  • [*][*][*][*][*]
  • Global Moderator
Wavegain vs. MP3Gain
Reply #139
After avidly following Jebus' quest, I have now written something similar into my batch files.

As Jebus says, there has to be some intermediary application or script to get the value from WaveGain into LAME (my batch file being that script).

I've had a look at LameGain.vbs and it's very nicely done.  Kudos to Jebus for initiating  this thread, and doggedly pursuing it until the bitter end!

I  use ACDIR instead of WaveSplit simply as it can pipe from the image WAVE to LAME instead of having to write track files to the hard drive first, and it can read meta data from the cuesheet, like TITLE and PERFORMER commands, which I can pass to LAME for tagging.  NB: Jebus uses ID3.EXE to tag as it has more functionality.

My batch files(s) archive to a Monkey's Audio image with cuesheet and optionally (if the CRC checksum checkbox is checked) create scaled track MP3s at the same time - very similar to the WACK bundle which Jebus was kind enough to put together.

There is an explanation of my batch files on my website (see below) - but not yet with the new functionality.  I hope to update the site to my new files in the near future.
I'm on a horse.

  • wdk40
  • [*]
Wavegain vs. MP3Gain
Reply #140
i've read this post many times and i'm still a little confused ...
my understanding is after using EAC to get the WAV files, run WaveGain to perform analysis on the whole album (cd).  then use the value generated by WaveGain as input to lame (via the --scale switch).  so far so good, right?

sorry for my ignorance (but how else will i learn w/o asking) why not let WaveGain modify the WAV files directly?

on a related note, what if i am creating a compliation of songs from various cds.  would i run wavegain on the entire collection, as if it were a CD, or individually?
thanks,
wdk40

  • Jebus
  • [*][*][*][*][*]
  • Developer
Wavegain vs. MP3Gain
Reply #141
Quote
i've read this post many times and i'm still a little confused ...
my understanding is after using EAC to get the WAV files, run WaveGain to perform analysis on the whole album (cd).  then use the value generated by WaveGain as input to lame (via the --scale switch).  so far so good, right?

sorry for my ignorance (but how else will i learn w/o asking) why not let WaveGain modify the WAV files directly?[a href="index.php?act=findpost&pid=313647"][{POST_SNAPBACK}][/a]


That was my original question. The answer is: because that introduces an additional lossy step. Lame has to requantify anyhow, so why not do it all at once? But you certainly could do it that way as well.

And yes, you've got all that right.

  • Jebus
  • [*][*][*][*][*]
  • Developer
Wavegain vs. MP3Gain
Reply #142
Quote
what if i am creating a compliation of songs from various cds.  would i run wavegain on the entire collection, as if it were a CD, or individually?
thanks,
wdk40
[a href="index.php?act=findpost&pid=313647"][{POST_SNAPBACK}][/a]


Well, ideally you'd wavegain each source album and use those values... Or you could use track gain instead of album gain, but then tracks that are supposed to be quieter won't be.

  • wdk40
  • [*]
Wavegain vs. MP3Gain
Reply #143
Quote
Quote
what if i am creating a compliation of songs from various cds.  would i run wavegain on the entire collection, as if it were a CD, or individually?
thanks,
wdk40
[a href="index.php?act=findpost&pid=313647"][{POST_SNAPBACK}][/a]


Well, ideally you'd wavegain each source album and use those values... Or you could use track gain instead of album gain, but then tracks that are supposed to be quieter won't be.
[a href="index.php?act=findpost&pid=313649"][{POST_SNAPBACK}][/a]



ok...i'm still trying to understand this.
If I rip a CD and use WaveGain (on the album as a whole) and then encode to MP3, all the MP3 files will be adjusted relative to the album.  So let's say I do this for a few CDs.  At some later time suppose I want to take a few MP3s from each of the ripped CDs and create a compilation.  Since the MP3 were all adjusted relative to their respective source CDs, shouldn't I re-adjust them relatative to the 'new' compilation?  If so, how do I do that?

Or would it be more flexible (but more expensive in terms of filesize) if I apply the gain adjustment after the MP3s are created?

thanks for all your help!

  • Jebus
  • [*][*][*][*][*]
  • Developer
Wavegain vs. MP3Gain
Reply #144
Well, not really... try track gaining something from ministry and then, say, tori amos, and I guarantee the tori amos is gonna sound way too loud in comparison. That's cause it is SUPPOSED to be quieter music! The replaygain algorithm doesn't know that!

So...

Lets say you're taking a softer track from one album and putting it on a mix CD with a bunch of heavy stuff. Using track gain would make the tracks the same perceived loudness, but is that what you want? Most likely you want the heavy stuff to be heavy, and the soft track to be soft, like they were on their respective source albums, right?

By using album gain, you are adjusting all tracks on a CD by the AVERAGE track gain, essentially. This means that the heavier tracks will remain a bit louder, and the softer tracks a bit softer. The dynamic range of the source CD doesn't change. The ONLY thing that changes is that your CDs are on average the same volume regardless of when they were recorded. So making a mix CD at this point will sound good, with more-or-less proper dynamics being preserved.

And if you don't like the way it sounds, you are always free to apply mp3gain in track mode, even after doing the whole wavegain thing. And mp3gain changes can be reversed afterwards of course, so no harm done.

I'd like to mention that this still isn't quite perfect - making a mix CD of say one track from a completely mellow CD and one from a completely heavy CD will of course result in the mellow track sounding too loud. Sometimes I pull out mp3gain and do a bit of tweaking by ear when the mix disc needs to be perfect.

Hope this makes some sense. Play with it! You'll figure it out.
  • Last Edit: 03 August, 2005, 12:52:18 AM by Jebus

  • wdk40
  • [*]
Wavegain vs. MP3Gain
Reply #145
Jebus - once again, thanks for your help.

I've been using your LameGain script and have a question.  Why do rip the CD to an image file/CUE sheet rather than ripping individual tracks?  Just curious ...

  • Jebus
  • [*][*][*][*][*]
  • Developer
Wavegain vs. MP3Gain
Reply #146
Its a hack... because i need it to run wavegain only after ripping the entire CD. This way it only runs LameGain once at the end.

The side-effect (benefit) is that you don't really need to run LameGain from EAC at all, but can use it from a command-line. So you could for instance store the cue sheets and FLAC the wav images, then make MP3s automatically out of them later.

The downside is that after ripping it needs to split it into separate tracks, which takes a bit of time.

By the way, please upgrade to the latest version of LameGain (2.2), which should be the last one for a while... fixes all known bugs.

  • dli
  • [*]
Wavegain vs. MP3Gain
Reply #147
Jebus,

I see in your script that you are running wavegain -a -x on the directory of individual split WAV tracks. Now, based on my understanding of the matter running the analysis on the WAV image instead should yield the exact same scale factor. However, a quick test I ran does show discrepancies (0.5623 for individual tracks vs. 0.5630 for the full image). Any explanation?

  • Otto42
  • [*][*][*][*][*]
Wavegain vs. MP3Gain
Reply #148
Running wavgain on the full image would include those 2 second silences in between the tracks, which would increase the necessary gain slightly (I'd think). The split tracks shouldn't have those silences in them.

  • wdk40
  • [*]
Wavegain vs. MP3Gain
Reply #149
Quote
The side-effect (benefit) is that you don't really need to run LameGain from EAC at all, but can use it from a command-line. So you could for instance store the cue sheets and FLAC the wav images, then make MP3s automatically out of them later.
[a href="index.php?act=findpost&pid=317872"][{POST_SNAPBACK}][/a]



I tried to run LameGain from the command line but recieved an error when it attempts to parse the wav into separate tracks.  The error popup from LameGain says: Error splitting source WAVE into separate tracks.

It works fine from within EAC though ....

any suggestions?