Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8a1d240341 | |||
| f63bf23722 |
@@ -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)
|
||||||
|
|
||||||
@@ -118,7 +119,7 @@ def handle_ipc_client(conn, state):
|
|||||||
if prop == "pause":
|
if prop == "pause":
|
||||||
state.paused = bool(val)
|
state.paused = bool(val)
|
||||||
elif prop == "volume":
|
elif prop == "volume":
|
||||||
state.volume = float(val)
|
state.volume = max(0.0, min(100.0, float(val)))
|
||||||
elif prop == "time-pos":
|
elif prop == "time-pos":
|
||||||
state.seek_request = float(val)
|
state.seek_request = float(val)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user