feat: use cubic curve for natural volume scaling

Co-authored-by: aider (gemini/gemini-3.1-pro-preview) <aider@aider.chat>
This commit is contained in:
Tanner
2026-07-30 14:11:45 -06:00
parent d80d9a0172
commit f63bf23722
+2 -1
View File
@@ -70,7 +70,8 @@ def playback_thread(file_path, state):
# Apply volume # Apply volume
if vol != 100.0: if vol != 100.0:
multiplier = max(0.0, vol / 100.0) # Use cubic curve for more natural volume adjustment (human hearing is logarithmic)
multiplier = max(0.0, (vol / 100.0) ** 3)
arr = arr.astype(np.float32) * multiplier arr = arr.astype(np.float32) * multiplier
arr = np.clip(arr, -32768, 32767).astype(np.int16) arr = np.clip(arr, -32768, 32767).astype(np.int16)