From 4db12c6c0442a284b3c8c3b3aaf196aca546130a Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Tue, 1 Feb 2022 00:23:29 -0500 Subject: Fix panning --- src/mixer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mixer.c b/src/mixer.c index 0f3b5b1..3b49ba2 100644 --- a/src/mixer.c +++ b/src/mixer.c @@ -191,6 +191,8 @@ xas_audio_stream *xas_mixer_output(xas_mixer *mixer) { } static inline void input_set_pan(xas_mixer_input *input, float pan) { + static float range = 45.0f * (M_PI / 180.0); + float angle, term, cosf_angle, @@ -200,7 +202,7 @@ static inline void input_set_pan(xas_mixer_input *input, float pan) { return; } - angle = pan * (M_PI / 2.0f); + angle = pan * range; term = sqrtf(2.0f) / 2.0f; cosf_angle = cosf(angle); sinf_angle = sinf(angle); -- cgit v1.2.3