IPB

Welcome Guest ( Log In | Register )

3 Pages V   1 2 3 >  
Reply to this topicStart new topic
lower volume output to prevent clips
nzhk
post Sep 7 2006, 13:48
Post #1





Group: Members
Posts: 20
Joined: 6-September 06
Member No.: 34885



Can I lower volume output with any command in lame enc 3.97b3 or maybe with RazorLame?

I rip CDs with EAC and later convert the wav to mp3 with latest lame enc 3.97b3/ RazorLame latest version.
Mostly I keep both lossless wav and the lossy mp3 for my mp3 player
When converting the mp3 file back to wav to see if it created any vol clips in Sound Forge, I allmost always get volume clips when using clip detection.

Don't want to normalize, only lower the vol!
Easy done with Volume in SoundForge but I do not want to rip the CDs with SoundForge coz it isn't secure as EAC.

Know that EAC and dbPowerAmp has this but I rather not use it coz I always get better results with RazorLame.

I just need to lower the volume on the final mp3 by 0.4 - 0.6dB / about 94 - 95%, I do not want to change the original wav files.


Hope someone can tell me whats the easiest way to do this process.

This post has been edited by nzhk: Sep 7 2006, 14:07
Go to the top of the page
+Quote Post
smz
post Sep 7 2006, 14:11
Post #2





Group: Members
Posts: 601
Joined: 15-February 04
From: Venezia, Italia
Member No.: 12025



You can use mp3gain for that. Volume can be changed in 1.5 dB increments, IIRC, and it gives you indication about clipping or not. To do what you want you can use its "Apply Constant Gain" function, but you can also take into consideration the possibility to normalize your albums at "standard" average level of 89 dB using the "Apply Album Gain" function.

BTW, volume changes made by mp3gain are "lossless", that is it doesn't imply a transcoding. It just fiddle with some parameter into the mp3 frames and the changes you make can be reverted.

Cheers.

Sergio


--------------------
Sergio
Revox B150 + (JBL 4301B | Sennheiser HD430)
Go to the top of the page
+Quote Post
kjoonlee
post Sep 7 2006, 14:34
Post #3





Group: Members
Posts: 2526
Joined: 25-July 02
From: South Korea
Member No.: 2782



I'd just use foobar2000 to decode MP3s, with RG applied, no preamp, and clipping prevention on.

PS. If you don't want RG attenuation, choose source mode: none, and processing: prevent clipping according to peak. You'd still have to scan the files for RG info, though.


--------------------
http://blacksun.ivyro.net/vorbis/vorbisfaq.htm
Go to the top of the page
+Quote Post
nzhk
post Sep 7 2006, 14:36
Post #4





Group: Members
Posts: 20
Joined: 6-September 06
Member No.: 34885



tried that one.
But I need to change the wav file before converting to mp3.

I see no point in changing the final mp3 file,


If you use mp3gain, then you still have the clip but on a lower volume output.
The wave is still cut, the more you keep under that limit the more of the original sound you can save.


about clipping prevention in foobar:
this changes the file, limits the output.



to put it simple, I want to keep as much of the original structure as I can

This post has been edited by nzhk: Sep 7 2006, 14:42
Go to the top of the page
+Quote Post
Alex B
post Sep 7 2006, 14:47
Post #5





Group: Members
Posts: 1303
Joined: 14-September 05
From: Helsinki, Finland
Member No.: 24472



I process my MP3 albums (which I convert from my lossless archive) with MP3gain's "Maximum no-clip album gain" option. It keeps the relative track volume levels inside each album correct and prevents the tracks from clipping with all decoders (HW or SW).

With modern compressed pop/rock music it mostly changes the overall album level -1.5 dB. Sometimes -3.0 dB or even -4.5 dB is needed. I don't use the "undo tags" option since there's no reason to make the files to clip again. After that I analyze the files with foobar for creating the standard replay gain tags so I can choose between the album and track gain modes on PC playback.

This post has been edited by Alex B: Sep 7 2006, 14:49


--------------------
http://listening-tests.freetzi.com
Go to the top of the page
+Quote Post
smz
post Sep 7 2006, 14:50
Post #6





Group: Members
Posts: 601
Joined: 15-February 04
From: Venezia, Italia
Member No.: 12025



In your first post you said that:

QUOTE
When converting the mp3 file back to wav to see if it created any vol clips in Sound Forge, I allmost always get volume clips when using clip detection.

This can be a sign of clipping due to the mp3 decoding process. The solution I suggest will solve this issue.

If instead the clipping is already in the original wav, as it was ripped from the CD, then blame the mastering engineer and... there is nothing to do. Nobody will give you back information that is not available in the first place. You can lower the wav volume using WaveGain (available at http://www.rarewares.org/others.html), but that yes, will just lower the level of the clipped parts without "regenerating" them (an impossible process from a deterministic point of view, at most some program can exist to extrapolate interpolate the missing values).

Sergio

This post has been edited by smz: Sep 7 2006, 14:52


--------------------
Sergio
Revox B150 + (JBL 4301B | Sennheiser HD430)
Go to the top of the page
+Quote Post
nzhk
post Sep 7 2006, 14:56
Post #7





Group: Members
Posts: 20
Joined: 6-September 06
Member No.: 34885



I know, but as I said before, I rip the CDs with EAC to wav.
Ofcourse I have checked the original file.

The issue is, when encoding, clipping will be a fact if the original wav file is on max vol output/ 100%.

try and you will see

the sound wave changes and that change creates the clipping.
there is no point of removing clips if the clips are there.

I want to prevent clips.

I can do this with SoundForge I just need to make this process faster or automatic somehow

This post has been edited by nzhk: Sep 7 2006, 15:01
Go to the top of the page
+Quote Post
Alex B
post Sep 7 2006, 14:59
Post #8





Group: Members
Posts: 1303
Joined: 14-September 05
From: Helsinki, Finland
Member No.: 24472



QUOTE (nzhk @ Sep 7 2006, 16:36) *
tried that one.
But I need to change the wav file before converting to mp3.

I see no point in changing the final mp3 file,


If you use mp3gain, then you still have the clip but on a lower volume output.
The wave is still cut, the more you keep under that limit the more of the original sound you can save.


about clipping prevention in foobar:
this changes the file, limits the output.



to put it simple, I want to keep as much of the original structure as I can


MP3 files have correct unclipped waveform before decoding even the standard decoding process makes clipped 16-bit pcm output. MP3Gain (or e.g. foobar2000's replay gain) can change the volume level before decoding to 16-bit integer so that the decoded files remain unclipped (only the volume level is a bit lower).


--------------------
http://listening-tests.freetzi.com
Go to the top of the page
+Quote Post
smz
post Sep 7 2006, 15:03
Post #9





Group: Members
Posts: 601
Joined: 15-February 04
From: Venezia, Italia
Member No.: 12025



QUOTE (nzhk @ Sep 7 2006, 15:56) *
I know, but as I said before, I rip the CDs with EAC to wav.
Ofcourse I have checked the original file.

The issue is, when encoding, clipping will be a fact if the original wav file is on max vol output/ 100%.

try and you will see

the sound wave changes and that change creates the clipping.
there is no point of removign clips if the clips are there.

I want to prevent clips.

I can do this with SoundForge I just need to make this process faster or automatic somehow

I perfectly know what you mean, believe me, man. The problem is in the decoding part of the process. You try, you then tell! rolleyes.gif

Cheers!

Sergio

Edit: BTW, if you don't trust me, just try to search the forum (always a good idea). This issues has been already debated several times and the solution already offered several times.

This post has been edited by smz: Sep 7 2006, 15:05


--------------------
Sergio
Revox B150 + (JBL 4301B | Sennheiser HD430)
Go to the top of the page
+Quote Post
Alex B
post Sep 7 2006, 15:10
Post #10





Group: Members
Posts: 1303
Joined: 14-September 05
From: Helsinki, Finland
Member No.: 24472



Two weeks ago I posted a screenshot that illustrates how replay gain correction can prevent MP3 files from clipping: http://www.hydrogenaudio.org/forums/index....st&p=421963


--------------------
http://listening-tests.freetzi.com
Go to the top of the page
+Quote Post
nzhk
post Sep 7 2006, 15:11
Post #11





Group: Members
Posts: 20
Joined: 6-September 06
Member No.: 34885



ok :S
The sound wave gets destroyed when you increase the vol "over the top" on a original wav file.
You can't get that back as it was when lowering back the volume.
So how am I gonna do it on a mp3 file if I can't on a wav file tongue.gif

As I said, I want to prevent clipping not edit the mp3 file in anyway, even if I do not need to re-encode it tongue.gif

I just need to make the process faster or automatic somehow.

When ripping a CD, I do not want to touch the final mp3 file, just play it tongue.gif

This post has been edited by nzhk: Sep 7 2006, 15:12
Go to the top of the page
+Quote Post
kjoonlee
post Sep 7 2006, 15:18
Post #12





Group: Members
Posts: 2526
Joined: 25-July 02
From: South Korea
Member No.: 2782



The CDs either have clipping or they don't. You can't do anything about that.

The MP3s either have clipping or they don't. You can't do anything if it inherited clipping from the CD.

You can do something if there wasn't any clipping on the CD. You can turn down the volume at decode-time (or use MP3Gain) and you'll get unclipped output.

That's what people are trying to tell you. smile.gif


--------------------
http://blacksun.ivyro.net/vorbis/vorbisfaq.htm
Go to the top of the page
+Quote Post
smz
post Sep 7 2006, 15:21
Post #13





Group: Members
Posts: 601
Joined: 15-February 04
From: Venezia, Italia
Member No.: 12025



QUOTE (nzhk @ Sep 7 2006, 16:11) *
ok :S
The sound wave gets destroyed when you increase the vol "over the top" on a original wav file.
You can't get that back as it was when lowering back the volume.
So how am I gonna do it on a mp3 file if I can't on a wav file tongue.gif

As I said, I want to prevent clipping not edit the mp3 file in anyway, even if I do not need to re-encode it tongue.gif

I just need to make the process faster or automatic somehow.

I'm tempted to give up... blink.gif

case of where_is_it_clipped:

A) in the original, that is on the pressed CD. Do you think that can be a solution for that? NO!

B) in the process of encoding/decoding to/from mp3. By the heck, it is in the D_E_C_O_D_I_N_G (can you hear me?) part of the process an NOT (by definition) in the encoding.

mp3gain alters the "global gain" field of each mp3 frame so that it doesn't clip any more when (you guess when?) D_E_C_O_D_I_N_G.

Sergio


--------------------
Sergio
Revox B150 + (JBL 4301B | Sennheiser HD430)
Go to the top of the page
+Quote Post
Moneo
post Sep 7 2006, 15:22
Post #14





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



Adding --scale .95 to the LAME command-line parameters should do the trick.
Go to the top of the page
+Quote Post
smz
post Sep 7 2006, 15:27
Post #15





Group: Members
Posts: 601
Joined: 15-February 04
From: Venezia, Italia
Member No.: 12025



QUOTE (kjoonlee @ Sep 7 2006, 16:18) *
You can do something if there wasn't any clipping on the CD. You can turn down the volume at decode-time (or use MP3Gain) and you'll get unclipped output.

No, just turning the volume down will not prevent clipping, it will just lower the volume of the clippings.

What moneo suggested (to use --scale 0.95) can do the trick, but you can't be sure 100% and besides that it alters the original (as probably SoundForge does) and personally I don't like that. I prefer lossless alterations, and for a reason, I think.

Sergio


--------------------
Sergio
Revox B150 + (JBL 4301B | Sennheiser HD430)
Go to the top of the page
+Quote Post
kjoonlee
post Sep 7 2006, 15:31
Post #16





Group: Members
Posts: 2526
Joined: 25-July 02
From: South Korea
Member No.: 2782



OK, I should have said "You can turn down the volume using RG...".

QUOTE (smz @ Sep 7 2006, 23:27) *
No, just turning the volume down will not prevent clipping, it will just lower the volume of the clippings.

On second thought, I don't think that's true. The MP3 format is in floating point. Keep lowering the volume and the peaks will come down to less than the maximum integer peak.


--------------------
http://blacksun.ivyro.net/vorbis/vorbisfaq.htm
Go to the top of the page
+Quote Post
smz
post Sep 7 2006, 15:33
Post #17





Group: Members
Posts: 601
Joined: 15-February 04
From: Venezia, Italia
Member No.: 12025



QUOTE (kjoonlee @ Sep 7 2006, 16:29) *
OK, I should have said "You can turn down the volume using RG...".


Oh, yes! That yes! laugh.gif Sorry for the misunderstanding. In fact it is what I do. Just store ReplayGain information in the ID3v2 tags (not even alter the "global gain field") and use foobar or winamp with otachan plugin for listening without clipping. Anyway recently I bought a DAP and I'm now tempted to move to the "global gain" field solution, so that even my DAP doesn't clip...

Cheers!

Sergio


--------------------
Sergio
Revox B150 + (JBL 4301B | Sennheiser HD430)
Go to the top of the page
+Quote Post
nzhk
post Sep 7 2006, 15:35
Post #18





Group: Members
Posts: 20
Joined: 6-September 06
Member No.: 34885



What Moneo suggested works if the original wav file has no clipping.
Thanx Moneo !!!
smz, I know what you mean but the original wav I have tried with has no clipping and I do not want to create clipping in the mp3 file of a wav that does no have clipping tongue.gif


When playing a mp3 it gets decoded while playing.

If I encode a orignal wav file (that doesn NOT have clipping) to a mp3 file (256) and decode that mp3 to a new wav file with the same lame.
How can the mp3 have no clipping and the decoded file have when in the end of the play or decode process you will have the same audio tongue.gif

This post has been edited by nzhk: Sep 7 2006, 15:36
Go to the top of the page
+Quote Post
smz
post Sep 7 2006, 15:44
Post #19





Group: Members
Posts: 601
Joined: 15-February 04
From: Venezia, Italia
Member No.: 12025



QUOTE (kjoonlee @ Sep 7 2006, 16:31) *
On second thought, I don't think that's true. The MP3 format is in floating point. Keep lowering the volume and the peaks will come down to less than the maximum integer peak.


It depends on where the volume adjustment is done. If it is embedded in the mp3 decoder, that can be true. If you just use the kmixer... the clipping is already there. I don't know if any player act at the decoding level for volume adjustement, but I don't think so. I may be wrong, though...

Sergio

Edit: fixed a mess that I mad trying to answer to another post.


QUOTE (nzhk @ Sep 7 2006, 16:35) *
If I encode a orignal wav file (that doesn NOT have clipping) to a mp3 file (256) and decode that mp3 to a new wav file with the same lame.
How can the mp3 have no clipping and the decoded file have when in the end of the play or decode process you will have the same audio tongue.gif

Would you please invest some of your time and give a try to the solution I suggested?


The FACT is that there is no clipping in the mp3 itself. The clipping is generated at (you guess when?) D_E_C_O_D_I_N_G time.

Sergio

EDIT:
What the heck... I can't post a new answer.. everything goes inside this one... sorry.. don't know what's going on. This is an answer to two different post, thus...

This post has been edited by smz: Sep 7 2006, 15:46


--------------------
Sergio
Revox B150 + (JBL 4301B | Sennheiser HD430)
Go to the top of the page
+Quote Post
nzhk
post Sep 7 2006, 15:45
Post #20





Group: Members
Posts: 20
Joined: 6-September 06
Member No.: 34885



hehe, maybe soon if I do not find a solution wink.gif

I am unsure of what Moneo suggested really will do the trick.

If I lower the vol (do as Moneo said) and the clipping doesn't occur in the decoded file.
Will the sound wave be prevented to go over that scale, and if so, the wave that normally woudl go over is it cut?
Go to the top of the page
+Quote Post
smz
post Sep 7 2006, 15:50
Post #21





Group: Members
Posts: 601
Joined: 15-February 04
From: Venezia, Italia
Member No.: 12025



QUOTE (nzhk @ Sep 7 2006, 16:45) *
hehe, maybe soon if I do not find a solution wink.gif

You have alredy been offered a solution but you can't understand it and you are unwilling to even try it. Too bad for you. You'll not be very apreciated in this community with this kind of attitude.


--------------------
Sergio
Revox B150 + (JBL 4301B | Sennheiser HD430)
Go to the top of the page
+Quote Post
Alex B
post Sep 7 2006, 16:04
Post #22





Group: Members
Posts: 1303
Joined: 14-September 05
From: Helsinki, Finland
Member No.: 24472



QUOTE (nzhk @ Sep 7 2006, 17:11) *
ok :S
The sound wave gets destroyed when you increase the vol "over the top" on a original wav file.
You can't get that back as it was when lowering back the volume.
So how am I gonna do it on a mp3 file if I can't on a wav file tongue.gif

As I said, I want to prevent clipping not edit the mp3 file in anyway, even if I do not need to re-encode it tongue.gif

I just need to make the process faster or automatic somehow.

When ripping a CD, I do not want to touch the final mp3 file, just play it tongue.gif

As said, you could use the scale switch with LAME encoder. Values like 0.93 and 0.95 have been recommended, but that is not always enough with the worst examples of over-compresssed recordings. For example, the test track in my screenshot needs something like 0.75 (this depends on the other encoding settings too).

You could analyze the files after encoding with foobar's replay gain, check how much they clip (if at all) and pick the most clipped file, then make a couple of more encodings with estimated scale switch values for finding the highest value that prevents from clipping and finally encode all files again with this value. This is a lot of work.

IMHO, the easy and reliable method is to load the files to MP3gain and let it batch process them to "Maximum no-clip album gain". As I said, this prevents the files from clipping with any decoder. MP3gain does not transcode, it just adjust the volume level. MP3 files are always already altered from the original source and this change can only make them better (IMHO again).

The "clip-prevented" files" can be analyzed for replay gain tags afterwards. Replay gain tags can be used in addition for making the usual playback options available (track or album gain, gain adjustments etc).


--------------------
http://listening-tests.freetzi.com
Go to the top of the page
+Quote Post
nzhk
post Sep 7 2006, 16:06
Post #23





Group: Members
Posts: 20
Joined: 6-September 06
Member No.: 34885



come on, I was offered a solution I probably do not agree with tongue.gif

If someone ask you a question and you feel you know the answer but the one that asked it doesn't agree, is that really a solution.
Can and can not be...

Btw I do not think no one will remember me here anyway wink.gif

I just want to consider other options, easier smile.gif

Ok I'll be nice and and ask a new easy question.
Does anyone know any vol tool that does the same thing as Volume in SoundForge.
example, you have 10 wav files you have ripped with EAC and all the wav files you want to lower the vol by 0.5-0.6dB (and ofcourse keep the original as before and but make the new wav files with the desired lowered vol.)
Go to the top of the page
+Quote Post
2Bdecided
post Sep 7 2006, 16:19
Post #24


ReplayGain developer


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



QUOTE (nzhk @ Sep 7 2006, 15:11) *
ok :S
The sound wave gets destroyed when you increase the vol "over the top" on a original wav file.
You can't get that back as it was when lowering back the volume.
So how am I gonna do it on a mp3 file if I can't on a wav file tongue.gif



Background

With fixed point data, 0dB FS, or “digital full scale” is the largest value you can store - anything bigger will be clipped to that largest possible value.

With floating point data, 0dB is normally defined somewhere near the middle of the possible range. With audio data, typical 32-bit floating point representation gives you over 1000dB range - a lot of space above conventional 0dB FS


So the answer to your question is this: because .wav files from CDs are fixed-point data (16-bit integers), while mp3 files are floating point data.

This particular floating point data is (nearly) impossible to clip. The headroom is amazingly large (at least 100dB more than you need).

mp3s are normally decoded to fixed point data (typically 16-bit integers), though other options are available.


The solution you have been given does work. Try it.


Otherwise, just add the --scale 0.9 switch to lame.

(FAQs and manuals are great things!)

Cheers,
David.

This post has been edited by 2Bdecided: Sep 7 2006, 16:21
Go to the top of the page
+Quote Post
nzhk
post Sep 7 2006, 16:22
Post #25





Group: Members
Posts: 20
Joined: 6-September 06
Member No.: 34885



ok ok, I am gonna try but have I understood it correct, you all sayin I do not need to lower the vol at all?
Go to the top of the page
+Quote Post

3 Pages V   1 2 3 >
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: 31st October 2014 - 23:22