Help - Search - Members - Calendar
Full Version: Scale Or Gain
Hydrogenaudio Forums > Lossy Audio Compression > MP3 > MP3 - General
Corezode
I am not quite sure about this but here goes

When most people encode to mp3 they use mp3gain to make all their mp3's the same loudness

But of course mp3gain is lossless but if you scale the sample in lame before you encode it is lossy

But here is what i understand if you encode to mp3 you most certainly get clipping and hence when using mp3gain it will lower the volume of your songs to the same volume so your music has the same loundness, and winamp etc... will not clip badly when playing the song back.

But when lame was encoding the song it clipped therefore loosing data and getting distortion and when mp3gain lowers the volume it still has the data lost but looks like it hasn't clipped when viewing the waveform but still has the sound of a clipped sample.

So even if you scale samples it might be lossy so why

I tell you why, say when encoding with lame you use --scale 0.9 or something similiar it will stop lame from clipping on the song, therefore no distortion and then you can perform mp3gain to achieve the same volume.

As now it is late and i am tired, so i might be talking complete crap
Omion
Well, LAME doesn't clip when it encodes things. If LAME makes a certain waveform go above full scale, that information is still in the file - it just can't be played back without scaling the volume down.

MP3s can have two types of clipping:
* Source clipping - the stuff that's already on the CD. No way to undo this nicely
* Playback clipping - When your MP3 player tries to play something more than full scale. Easily fixed with MP3gain

There's no clipping that occurs on the MP3 encoding stage - just source clipping and playback clipping.

This means that (as far as I know) there's no reason to use --scale if you're going to use MP3gain anyway.
Lyx
btw: mp3gain is not completely lossless in every aspect. It is lossless as in that it doesn't change anything to the audiostream itself(except of the amplification modifier). But unless you save undo-data (which has been known to have not-so-nice sideeffects), you cannot undo/restore the scale to its original-level. On a per-track-basis, thats not such a big problem - but on an album-wide scale it can very well have ugly consequences. imagine this:

You have an album with seamless trackchanges. Then you accidentelly apply TRACKGAIN to every track - you disable the saving of undo-data because of the problems it causes with certain applications........ congratulations: you have just destroyed the trackchanges of the entire-album and cannot repair the damage because of missing undo-data.

Thats why i prefer tag-based replaygain - but of cause that has the disadvantage that the scale gets only applied with players which support it.

- Lyx
kjoonlee
Disclaimer: I might be wrong.

If you had used LAME to encode, using mp3gain to change the volume diretly will alter the file. The LAME header contains a checksum value, which can be used to check if the volume has been changed.

If the above is true, then it might be possible to write a program that keeps altering the volume of an MP3 file until the checksum matches.

edit: spelling.
SamK
QUOTE(kjoonlee @ Feb 20 2005, 02:27 PM)
If the above is true, then it might be possible to write a program that keeps altering the volume of an MP3 file until the checksum matches.


or try to guess original trackchanges from various hints (background noise levels if recording was homogenous enough, peak values if all the tracks were peak-maxed..)
Since the changes are 1.5dB increments, a lot can be tried to guess the original levels.
Anyway that's all wishful thinking, in practise, you either leave them track-gained, or find some non-modified older copy (or just re-rip).

I agree this issue happens with mp3gain, and is one of the reasons to prefer RG tags (being able to choose at playback between track and album RG is the biggest reason though, IMO).

in my experience, this happened when I was using foobar to tag files (freedb and mass-tagging is sweet), then mp3gained, then later changed a few tags with foobar... ooh-ooh, forgot to reload info from files, => tags are overwritten to previous state, undo data lost :-(

That's really a tricky trap. I wasted hours and hours of finding back original levels due to this :-(

Now I click "reload info from files" in foobar all the time :/
(I used to avoid mp3gain altogether after that, but since I bought a DAP mp3gain is too useful)
Jojo
QUOTE(Lyx @ Feb 20 2005, 03:14 AM)
btw: mp3gain is not completely lossless in every aspect. It is lossless as in that it doesn't change anything to the audiostream itself(except of the amplification modifier). But unless you save undo-data (which has been known to have not-so-nice sideeffects), you cannot undo/restore the scale to its original-level. On a per-track-basis, thats not such a big problem - but on an album-wide scale it can very well have ugly consequences.
*


what are you talking about? It is lossless! You will not loose any information...it's the same like editing a wav file...once the change is done it's done. That's why mp3Gain offers to keep track of the original volume level so it can be restored. But even without that information you can get back to the original volume. You just have to remember the volume...but why would it be so important to get the exact same volume back anyway? I simply let mp3Gain keep track of the changes...but what are the "not-so-nice sideeffects"? It works for me and I tag my mp3's using APEv2 Tags anyway.

For people that don't want to save the undo information as APEv2 Tags (but still need them for some reason), could easily export the filelist in mp3Gain (with the original volumes) before applying the changes...
Corezode
I ripped a song with eac and took a snapsoht into gif format and then converted it into mp3 "preset stanard" and then took a snapshot of the waveform to show the clipping.

But now I have two pictures i want to show you but i do not know how to attach the files or host them ?
2Bdecided
QUOTE(Lyx @ Feb 20 2005, 11:14 AM)
btw: mp3gain is not completely lossless in every aspect. It is lossless as in that it doesn't change anything to the audiostream itself(except of the amplification modifier). But unless you save undo-data (which has been known to have not-so-nice sideeffects), you cannot undo/restore the scale to its original-level. On a per-track-basis, thats not such a big problem - but on an album-wide scale it can very well have ugly consequences. imagine this:

You have an album with seamless trackchanges.


so you're probably intending to apply Album gain? But unfortunately...

QUOTE
Then you accidentelly apply TRACKGAIN to every track - you disable the saving of undo-data because of the problems it causes with certain applications........ congratulations: you have just destroyed the trackchanges of the entire-album and cannot repair the damage because of missing undo-data.


Well, it's worth watching out for - but only as much as you shouldn't select a bunch of files in Windows and click delete when you meant to click copy!

I agree it's misleading to simply say

"mp3gain is lossless"

because a newbie might not realise it's shorthand for

"mp3gain alters some data within an mp3 file in a perfectly reversible way, as long as you keep a record of the change either within a tag or a separate file or database. mp3gain is lossless in that, if use it to apply a certain gain, then apply the opposite gain, you will get back to the original file - whereas wavgain (etc) is not lossless because you can almost never reverse the gain change and get back to exactly the original file due to finite bitdepth and dither/truncation etc".

However, you can see why people prefer to say the former, rather than the latter!

QUOTE
Thats why i prefer tag-based replaygain - but of cause that has the disadvantage that the scale gets only applied with players which support it.

- Lyx
*



There's a lot to be said for applying the album gain, but using tags for everything else in a compatible manner. I think people have reported using tags to make this work in a compatible way.

Cheers,
David.
kjoonlee
Slightly off topic, but the Japanese term for "lossless" is "reversible," and "lossy" is "irreversible." smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.