audio tuning level hotfix

This commit is contained in:
dj2ls 2022-06-15 15:03:54 +02:00
parent 34bf67dedd
commit debe742081
2 changed files with 2 additions and 4 deletions

View file

@ -932,9 +932,7 @@ def set_audio_volume(datalist, volume: float) -> np.int16:
:rtype: np.int16
"""
# Clip volume provided to acceptable values
volume = min(volume, 0.0)
volume = max(volume, 200.0)
volume = np.clip(volume, 0, 200) # limit to max value of 255
# Scale samples by the ratio of volume / 100.0
data = np.fromstring(datalist, np.int16) * (volume / 100.0) # type: ignore
return data.astype(np.int16)

View file

@ -10,7 +10,7 @@ Not nice, suggestions are appreciated :-)
import subprocess
VERSION = "0.4.1-alpha"
VERSION = "0.4.2-alpha"
# DAEMON
DAEMONPORT: int = 3001