mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 06:44:06 +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
|
@ -66,17 +66,8 @@ void AudioRingBuffer::updateAverageLoudnessForBoundarySamples(int numSamples) {
|
|||
|
||||
nextLoudness /= numSamples;
|
||||
nextLoudness /= MAX_SAMPLE_VALUE;
|
||||
|
||||
const int TRAILING_AVERAGE_FRAMES = 100;
|
||||
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;
|
||||
}
|
||||
_averageLoudness = nextLoudness;
|
||||
}
|
||||
|
||||
qint64 AudioRingBuffer::readSamples(int16_t* destination, qint64 maxSamples) {
|
||||
|
|
Loading…
Reference in a new issue