-
Notifications
You must be signed in to change notification settings - Fork 462
Open
Labels
Description
How about adding something like an "automatic gain limiter" to the AudioOutput class?
I imagine it the following way:
- user does
output->setGain(2.5)
- or something which is a bit too high - user does
output->enableGainLimiter(true)
- during playback, the output class initially uses the gain set by users parameter.
- whenever the output sample (after Amplify) would be above/below a certain threshold - say 96% of MAX - the gain value is slightly reduced and the output sample is re-computed (i.e. repeat Amplify step).
This would be an easy way to reduce gain and avoid sound saturation. Its not a real "AGC", but a lightweight version that avoids some complications because it only reduces amplification, but never increases it.
What do you think?
Mir1001