From 58f114bba009af49a202494357e4b86134d90054 Mon Sep 17 00:00:00 2001 From: Pax1601 Date: Tue, 15 Oct 2024 21:01:22 +0200 Subject: [PATCH] Changed shape of distance volume curve --- frontend/react/src/audio/audiounitpipeline.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/react/src/audio/audiounitpipeline.ts b/frontend/react/src/audio/audiounitpipeline.ts index cf1ca98b..5702b99e 100644 --- a/frontend/react/src/audio/audiounitpipeline.ts +++ b/frontend/react/src/audio/audiounitpipeline.ts @@ -80,7 +80,7 @@ export class AudioUnitPipeline { /* Don't bother updating parameters if the client is too far away */ if (this.#distance < this.#maxDistance) { /* Compute a new gain decreasing with distance. */ - let newGain = 1.0 - Math.pow(this.#distance / this.#maxDistance, 2); // Arbitrary + let newGain = 1.0 - Math.pow(this.#distance / this.#maxDistance, 1); // Arbitrary /* Set the values of the main gain node and the multitap gain node, used for reverb effect */ this.#gainNode.gain.setValueAtTime(newGain, getApp().getAudioManager().getAudioContext().currentTime);