mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +02:00
Add audio meter ballistics for less display jitter (10ms attack, 300ms release)
This commit is contained in:
parent
2617febbcd
commit
d014dc2d14
1 changed files with 5 additions and 1 deletions
|
@ -1222,7 +1222,11 @@ void AudioClient::handleMicAudioInput() {
|
|||
|
||||
// detect loudness and clipping on the raw input
|
||||
bool isClipping = false;
|
||||
_lastInputLoudness = computeLoudness(inputAudioSamples.get(), inputSamplesRequired, _inputFormat.channelCount(), isClipping);
|
||||
float inputLoudness = computeLoudness(inputAudioSamples.get(), inputSamplesRequired, _inputFormat.channelCount(), isClipping);
|
||||
|
||||
float tc = (inputLoudness > _lastInputLoudness) ? 0.378f : 0.967f; // 10ms attack, 300ms release @ 100Hz
|
||||
inputLoudness += tc * (_lastInputLoudness - inputLoudness);
|
||||
_lastInputLoudness = inputLoudness;
|
||||
|
||||
if (isClipping) {
|
||||
_timeSinceLastClip = 0.0f;
|
||||
|
|
Loading…
Reference in a new issue