Normalize

From Avisynth wiki
Revision as of 17:29, 8 November 2015 by Raffriff42 (Talk | contribs)

Jump to: navigation, search

Normalize(clip clip [, float volume] [, bool show])

Amplifies the entire waveform as much as possible, without clipping.

By default the clip is amplified to 1.0, that is maximum without clipping - higher values are sure to clip, and create distortions. If one volume is supplied, the other channel will be amplified the same amount.

Starting from v2.08 there is an optional argument show, if set to "true", it will show the maximum amplification possible without distortions.

Stereo channels are never amplified separately by the filter, even if level between them is very different. The two volumes are applied AFTER the maximum peak has been found, and works in effect as a separate Amplify. That means if you have two channels that are very different the loudest channel will also be the peak for the lowest. If you want to normalize each channel separately, you must use GetChannel to split up the stereo source. Audio is converted to 16 bits as a side-result of this filter.

Examples:

# normalizes signal to 98%:
video = AviSource("C:\video.avi")
audio = WavSource("c:\autechre.wav")
audio = Normalize(audio, 0.98)
return AudioDub(video, audio)
# normalizes each channel separately:
video = AviSource("C:\video.avi")
audio = WavSource("bjoer7000.wav")
left_ch = GetChannel(audio,1).Normalize()
right_ch = GetChannel(audio,2).Normalize()
audio = MergeChannels(left_ch, right_ch)
return AudioDub(video, audio)
# normalizes each channel separately:
clip = AviSource("D:\Video\rawstuff\stereo-test file_left(-6db).avi")
left_ch = GetChannel(clip,1).Normalize()
right_ch = GetChannel(clip,2).Normalize()
audio = MergeChannels(left_ch, right_ch)
AudioDub(clip, audio)
Personal tools