From ebe11151f43e461704a7e27a69cdfba1b74c4083 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 1 Apr 2013 13:05:51 -0700 Subject: [PATCH] use the source attenuation ratio when mixing --- mixer/src/main.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mixer/src/main.cpp b/mixer/src/main.cpp index fe5b09fb26..bb97dab353 100644 --- a/mixer/src/main.cpp +++ b/mixer/src/main.cpp @@ -191,17 +191,22 @@ void *sendBuffer(void *args) // pull the earlier sample for the delayed channel int earlierSample = delaySamplePointer[s] * - distanceCoeffs[lowAgentIndex][highAgentIndex]; + distanceCoeffs[lowAgentIndex][highAgentIndex] * + otherAgentBuffer->getAttenuationRatio(); plateauAdditionOfSamples(delayedChannel[s], earlierSample * weakChannelAmplitudeRatio); } int16_t currentSample = (otherAgentBuffer->getNextOutput()[s] * - distanceCoeffs[lowAgentIndex][highAgentIndex]); + distanceCoeffs[lowAgentIndex][highAgentIndex] * + otherAgentBuffer->getAttenuationRatio()); plateauAdditionOfSamples(goodChannel[s], currentSample); if (s + numSamplesDelay < BUFFER_LENGTH_SAMPLES_PER_CHANNEL) { - plateauAdditionOfSamples(delayedChannel[s + numSamplesDelay], currentSample * weakChannelAmplitudeRatio); + plateauAdditionOfSamples(delayedChannel[s + numSamplesDelay], + currentSample * + weakChannelAmplitudeRatio * + otherAgentBuffer->getAttenuationRatio()); } } }