diff options
Diffstat (limited to 'src/mumble/AudioOutput.cpp')
-rw-r--r-- | src/mumble/AudioOutput.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mumble/AudioOutput.cpp b/src/mumble/AudioOutput.cpp index 3216ee286..33ebf6c5d 100644 --- a/src/mumble/AudioOutput.cpp +++ b/src/mumble/AudioOutput.cpp @@ -95,6 +95,7 @@ AudioOutput::~AudioOutput() { // close, we'll hear it full intensity from the left side, and "bloom" intensity from the right side. float AudioOutput::calcGain(float dotproduct, float distance) { + // dotproduct is in the range [-1, 1], thus we renormalize it to the range [0, 1] float dotfactor = (dotproduct + 1.0f) / 2.0f; float att; @@ -103,6 +104,8 @@ float AudioOutput::calcGain(float dotproduct, float distance) { if (Global::get().s.fAudioMaxDistVolume > 0.99f) { att = qMin(1.0f, dotfactor + Global::get().s.fAudioBloom); } else if (distance < Global::get().s.fAudioMinDistance) { + // Fade in blooming as soon as the sound source enters fAudioMinDistance and increase it to its full + // capability when the audio source is at the same position as the local player float bloomfac = Global::get().s.fAudioBloom * (1.0f - distance / Global::get().s.fAudioMinDistance); att = qMin(1.0f, bloomfac + dotfactor); |