Normalise Bug in Chain?[SOLVED]

Spurred on by my earlier post I have been looking at a chain to convert my library of wav files into normalised flac files.

However, I have come across some strange behaviour in the preliminary test on 3 files.

Of these two performed as expected, but the third (actually the first in the series) that initially had fairly low levels were further reduced on the normalise pass.

At the same time applying normalise with the same parameters on the standalone file produced the expected behaviour.

I can supply the file if anybody is interested, a 46mb wav file.

Any ideas?

To what level are you normalizing the tracks?


Import the normalised “low level” file into a fresh Audacity Project.
Select the entire track, then select the “Amplify” effect.
The Amplify effect should offer to amplify by +2 dB.
Apply the effect, then look carefully at the waveform. I suspect that somewhere in the track there is a small spike that has an unusually high amplitude (note that “spikes” may be up or down).

Nope, Amplify is proposing 9.8db.

There are no spikes, and no clipping warning when I amplify by 9.8db.

Would it help if I try to post the file?

Try applying Normalize to the file on its own (not in a chain). Does it normalize correctly?

That works.

Could you see if you are able to reproduce the problem? - perhaps generate some short tones from the Generate menu so that you know exactly what there peak amplitude is and export them as files. If you are able to reproduce the problem, please give step by step details of what you are doing.

OK, I have had a go at this and am unable to reproduce the error on a test file with a generated tone.

However, the original file I detected this issue on has consistently failed to produce the correct results via the Chain, on perhaps on 3-4 attempts.

Perhaps if I send you the file via dropbox?

Yes if you can upload the file somewhere and post a link I’ll take a look. Thanks.

I’ll send you the link via PM, Steve. Thanks for your help.

I think I’ve found the problem.
As a workaround, set the following Preference and I think Normalize will work correctly:
Edit menu > Preferences > Import/Export
“When importing audio files” > “Make a copy”

Thanks Steve, that certainly fixed the issue on the problem file.

Can you elaborate a little further on the problem and perhaps how common it might be? Also whether it is something that might be patched in future?

Would just like to understand the probabilities of this issue cropping up again if I process a bunch of files I couldn’t realistically check exhaustively.

It’s a pretty obscure bug that requires a specific series of conditions (hence it took me a while to pin down how to reproduce the issue).
I’ve added a bug report and the details are here: so the bug will be picked up and fixed in due course.

Unless you are frequently working on very long audio files it is probably best to leave the Preference setting to “When importing audio files” > “Make a copy”. Not only will that work around this bug but it is a generally safer option.

Thanks again, Steve; sorry to create more work for you but I appreciate the further info.

I guess what is troubling me is that the the Normalise function appears to work properly as a standalone function, suggesting to my inexperienced eye there may be something broader wrong with the way Chains are initialised.

Anyway, I think I’ll proceed with caution for now and see what the developers come up with.

I don’t think the problem is with “the way Chains are initialised”.
The fact that you saw the problem with the first file in the batch was a red herring.

The conditions that make the issue occur are:

  • “Read Directly” is selected in Preferences.
  • The warning message for importing uncompressed audio is disabled.
  • The imported file is in an uncompressed format (for example .WAV)
  • The file is long enough that it is not automatically copied.
  • The original peak level is not 0 dB (otherwise the bug is invisible).
  • The Normalize effect is used in a Chain.
  • The Chain is applied to files (not the current project)

What I think is happening (or rather “not happening”) is that the Chain command is failing to pass the peak level to the Normalize effect, so Normalize assumes a default peak level of 0 dB. The Chains code was updated a while back and I suspect that the developer simply forgot about passing this data to Normalize. I think that Normalize is the only effect that actually needs to know the peak level of the audio. The only other effect that I think may possibly have a similar problem is the Noise Removal effect but I would imagine that it will be obvious to the developer if this is the case or not when they re-examine the code.

This should be fixed in 2.0.1. The problem turned out to be that Normalize was not waiting for On-Demand Loading to complete computing the waveform before starting its analysis.