From b31d28687a54b8786b5df44e8039b21702a68296 Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Wed, 16 Feb 2022 00:23:07 -0500 Subject: Change way of calculating amplitude by distance --- src/spatial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/spatial.c b/src/spatial.c index 36422b8..2d1fbe3 100644 --- a/src/spatial.c +++ b/src/spatial.c @@ -42,7 +42,7 @@ static inline size_t sample_delta(xas_spatial_scene *scene, float distance) { } static inline int16_t sample_scale(int16_t value, float distance) { - return (int16_t)roundf((float)value * (1.0f / powf(distance, 2.0))); + return (int16_t)roundf((float)value * (1.0f / distance)); } static void buffer_zero(xas_spatial_buffer *buffer, size_t count) { -- cgit v1.2.3