From 95cae1a1d530dc24f0254aa5fdc7b8f0c603690d Mon Sep 17 00:00:00 2001 From: Tanner Date: Thu, 30 Jul 2026 14:42:23 -0600 Subject: [PATCH] feat: map volume range to 25-100 before cubic scaling Co-authored-by: aider (gemini/gemini-3.1-pro-preview) --- main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index c060efa..04b5c79 100644 --- a/main.py +++ b/main.py @@ -70,8 +70,11 @@ def playback_thread(file_path, state): # Apply volume if vol != 100.0: + # Linearly map 0-100 to 25-100 so low volumes aren't too quiet + mapped_vol = 25.0 + (vol / 100.0) * 75.0 + # Use cubic curve for more natural volume adjustment (human hearing is logarithmic) - multiplier = max(0.0, (vol / 100.0) ** 3) + multiplier = max(0.0, (mapped_vol / 100.0) ** 3) arr = arr.astype(np.float32) * multiplier arr = np.clip(arr, -32768, 32767).astype(np.int16)