audiomentations
audiomentations copied to clipboard
Establish a common pattern for post-gain
A lot of the transforms may make the sound louder, which may result in digital clipping down the line. We should have a common way of doing post-gain to deal with this issue. Or a class that does the post-gain.
Like
GainCompensation(transform, method)
Examples:
GainCompensation(AddGaussianNoise(), method="same_rms")
GainCompensation(AddGaussianNoise(), method="same_lufs")
GainCompensation(AddGaussianNoise(), method="peak_normalize_always")
GainCompensation(AddGaussianNoise(), method="peak_normalize_if_too_loud")
GainCompensation(AddGaussianNoise(), method="target_rms", target_rms=0.01)
GainCompensation(AddGaussianNoise(), method="target_lufs", target_lufs=-23.0)
GainCompensation(AddGaussianNoise(), method="target_peak_dbfs", target_peak_dbfs=-1.0)
GainCompensation(AddGaussianNoise(), method="target_true_peak_dbfs", target_true_peak_dbfs=-1.0) # not to be supported in initial implementation
I like the idea of a GainCompensation transform.
Or maybe PostGain
is a better name?
That works too. Alternative names: AudioBus
or Fader
I think I prefer PostGain
. Because
-
GainCompensation
suggests that it's always about compensation, but not all methods I proposed are always "compensation" -
AudioBus
sounds a bit too vague for me. I wouldn't understand what it did by just looking at the name
What's better?
-
target_rms
-
target_rms_db
(and give the RMS value in decibel)