Make audio bus channels' peak volume consistent

Channels that are inactive -or when playback has not started yet- will report -200 dB as their peak value (which is also the lowest value possible during playback).
This commit is contained in:
Pedro J. Estébanez 2021-02-02 11:25:40 +01:00
parent 6ddfc8e718
commit a2b3a73e2d
3 changed files with 6 additions and 2 deletions

View file

@ -47,6 +47,9 @@ static inline float undenormalise(volatile float f) {
return (v.i & 0x7f800000) < 0x08000000 ? 0.0f : f;
}
static const float AUDIO_PEAK_OFFSET = 0.0000000001f;
static const float AUDIO_MIN_PEAK_DB = -200.0f; // linear2db(AUDIO_PEAK_OFFSET)
struct AudioFrame {
//left and right samples
float l, r;