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: Setting a scale factor in LAME (Read 8089 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Setting a scale factor in LAME

Can anybody tell me wether setting a scale factor in LAME degrades sound quality?

Setting a scale factor in LAME

Reply #1
Yes, scale can possibly have a negative effect on sound quality.  Usually with moderate values this is mostly negligible... however, I would advise using something like mp3gain or mp3clip (on the front page) over scale, as these programs adjust gain and remove clipping in a totally lossless manner while --scale does not.

Setting a scale factor in LAME

Reply #2
I always thought LAME would work with 24-bit-floating point internally. They would not suffer so bad from scaling.

So is the --scale setting already applied when reading the input file to integer values?

Setting a scale factor in LAME

Reply #3
That's was my idea also. But, on another forum, I got into a discussion  about sound degrading and was told that scaling was the same as scaling a Wav before encoding. It's hard to beleive that (I woulf not program an encoder that way...).

Setting a scale factor in LAME

Reply #4
I don't think the problem lies in the accuracy of the modification.. instead the problem is more that as volume is adjusted, this effects how the file is encoded because of how the psychoacoustic model may interpret it differently.  More of the audio will likely fall below the ath, masking may change, etc.  Plus, this process is irreversible.. this is why it is just better to use something like mp3gain which only adjusts the gain after encoding and does this in a completely lossless manner.

Setting a scale factor in LAME

Reply #5
Are you sure the scale factor is used before encoding??

Setting a scale factor in LAME

Reply #6
Yes, I am pretty sure.  The reason why is because when using --scale, the bitrate of the file will actually change.  If the file were scaled after it was encoded, this would not happen.

Setting a scale factor in LAME

Reply #7
OK, that sounds very logical...    How does MP3Gain change the volume?

Setting a scale factor in LAME

Reply #8
There are values for gain stored in the mp3 frames which you can modify which do not have any effect on the quality other than simply adjusting gain.  This process is also entirely lossless and reversible.  This is the method mp3gain uses.

Setting a scale factor in LAME

Reply #9
Hum, I see a potential source of confusion here: do not mix scale factor and scalefactors.

The --scale xxx option scales the input data once in floating point mode just before encoding. This is way better than some other scaling utilities because it's done in floating point mode, and not just plain 16 bits.
As Dibrom pointed, this will change how the encoder "perceives" sound, because the volume is not the same.

You might be confused because you could have heard that scalefactors are adjusted during encoding. Those scalefactors or definitively not the same as the scaling done by the --scale option.

Setting a scale factor in LAME

Reply #10
I may have a different version of the problem - suppose you are making mp3s from bootleg tapes.  Those mp3s are going to be widely circulated, so you want to do a really good encode, but still end up with something that plays well for most people without too much fiddling.  VBR is a given, but you want to be careful that you don't have other stuff that isn't going to decode right for lots of people.

I've seen the various threads recommending against normalizing wavs and against using scale in LAME, and instead recommending mp3gain.  The first question: Will the mp3gain data be read properly by enough decoders (without special plug-ins, etc.)?  (Many of the discussions in threads here are for someone using the mp3s themselves, rather than for circulation, so it's their own setup that matters.)

If the mp3gain info is decoded right for most, great, that's the answer (but see the second question).  If not, is there a reasonably safe use of scale in LAME or of wavgain that will get there?

The second question:  Often times the problem is that the volume levels on the tapes are really low ... like 20db below where they should be ... this also seems to be a different problem than most.  Suggestions on mp3gain, wavgain or -scale would be much appreciated. 

I always use --aps.  (Suggestions welcome there too.)

Or should we all just crank the volume?

Setting a scale factor in LAME

Reply #11
It'll be fine to use mp3gain. 

As for the 2nd question, I'd advise recording the tapes to wav using soundforge or cool edit, and applying any gain changes in there 1st.
"You can fight without ever winning, but never win without a fight."  Neil Peart  'Resist'

Setting a scale factor in LAME

Reply #12
Thanks.  So that means that the meta data is actually read by most decoders?  I saw the ReplayGain proposal  but wasn't sure what was actually implemented and how widely supported it was.

Any tips to avoid problems when increasing the gain on a wav?

Setting a scale factor in LAME

Reply #13
Quote
Originally posted by Dibrom
I don't think the problem lies in the accuracy of the modification.. instead the problem is more that as volume is adjusted, this effects how the file is encoded because of how the psychoacoustic model may interpret it differently.  More of the audio will likely fall below the ath, masking may change, etc.  Plus, this process is irreversible.. this is why it is just better to use something like mp3gain which only adjusts the gain after encoding and does this in a completely lossless manner.


I don't think this is correct. Amplifiers have a volume control.
--  Frank Klemm

Setting a scale factor in LAME

Reply #14
Buzzy- 

The easiest route to go is to use normalization in an audio editor ( I prefer SoundFOrge).  Use peak level and normalize to whatever you want.  I tend to go around -2dB for anything that has a large dynamic range, however you will want to play around with it cos if it's from tape that is already low in volume, there won't be much of a dynamic range
"You can fight without ever winning, but never win without a fight."  Neil Peart  'Resist'

Setting a scale factor in LAME

Reply #15
Quote
Originally posted by buzzy
Thanks.  So that means that the meta data is actually read by most decoders?  I saw the ReplayGain proposal  but wasn't sure what was actually implemented and how widely supported it was. 


MP3Gain needs no special support from the decoder to work. It will work automatically in anything that plays MP3.

--
GCP

Setting a scale factor in LAME

Reply #16
Quote
Originally posted by dreamliner77
Buzzy- 

The easiest route to go is to use normalization in an audio editor ( I prefer SoundFOrge).  Use peak level and normalize to whatever you want.  I tend to go around -2dB for anything that has a large dynamic range, however you will want to play around with it cos if it's from tape that is already low in volume, there won't be much of a dynamic range


This is a much inferior solution for reasons that were probably already posted 10x to the board.

And it certainly isn't easier either.

--
GCP

Setting a scale factor in LAME

Reply #17
Thanks all, I will experiment with mp3gain and maybe reread some of the threads on wavgain.