mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 17:49:27 +02:00
don't use a trailing average for loudness
This commit is contained in:
parent
6e41d93e0a
commit
1580896ec4
1 changed files with 1 additions and 10 deletions
|
@ -67,16 +67,7 @@ void AudioRingBuffer::updateAverageLoudnessForBoundarySamples(int numSamples) {
|
||||||
nextLoudness /= numSamples;
|
nextLoudness /= numSamples;
|
||||||
nextLoudness /= MAX_SAMPLE_VALUE;
|
nextLoudness /= MAX_SAMPLE_VALUE;
|
||||||
|
|
||||||
const int TRAILING_AVERAGE_FRAMES = 100;
|
_averageLoudness = nextLoudness;
|
||||||
const float CURRENT_FRAME_RATIO = 1.0f / TRAILING_AVERAGE_FRAMES;
|
|
||||||
const float PREVIOUS_FRAMES_RATIO = 1 - CURRENT_FRAME_RATIO;
|
|
||||||
const float LOUDNESS_EPSILON = 0.05;
|
|
||||||
|
|
||||||
_averageLoudness = (_averageLoudness * PREVIOUS_FRAMES_RATIO) + (CURRENT_FRAME_RATIO * nextLoudness);
|
|
||||||
|
|
||||||
if (_averageLoudness < LOUDNESS_EPSILON) {
|
|
||||||
_averageLoudness = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
qint64 AudioRingBuffer::readSamples(int16_t* destination, qint64 maxSamples) {
|
qint64 AudioRingBuffer::readSamples(int16_t* destination, qint64 maxSamples) {
|
||||||
|
|
Loading…
Reference in a new issue