From a3942a072f2c2057f40fe8a765a656c910f49e50 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 29 May 2013 17:38:00 -0700 Subject: [PATCH] more tuning on distance attenuation for audio mixer --- audio-mixer/src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/audio-mixer/src/main.cpp b/audio-mixer/src/main.cpp index 3d1690e39a..05ecaa1ed6 100644 --- a/audio-mixer/src/main.cpp +++ b/audio-mixer/src/main.cpp @@ -55,7 +55,7 @@ const float BUFFER_SEND_INTERVAL_USECS = (BUFFER_LENGTH_SAMPLES_PER_CHANNEL / SA const long MAX_SAMPLE_VALUE = std::numeric_limits::max(); const long MIN_SAMPLE_VALUE = std::numeric_limits::min(); -const float DISTANCE_SCALE = 5.0f; +const float DISTANCE_SCALE = 2.5f; const float PHASE_AMPLITUDE_RATIO_AT_90 = 0.5; const int PHASE_DELAY_AT_90 = 20; @@ -166,7 +166,7 @@ int main(int argc, const char* argv[]) { powf(agentPosition.z - otherAgentPosition.z, 2)); float minCoefficient = std::min(1.0f, - powf(0.3, + powf(0.4, (logf(DISTANCE_SCALE * distanceToAgent) / logf(2.5)) - 1)); distanceCoefficients[lowAgentIndex][highAgentIndex] = minCoefficient;