Fixed possible out of range byte value

Bytes need to be between 0 and 255, not 256
This commit is contained in:
Alfredo Fanghella
2017-10-20 00:38:16 -04:00
committed by GitHub
parent ccb88785e2
commit 7550a75356

View File

@@ -112,7 +112,7 @@ def change_sound(body, level=1):
if v > 128:
v = (v - 128) * level + 128
v = max(int(v), 128)
v = min(v, 256)
v = min(v, 255)
elif v < 128:
v = 128 - (128 - v) * level
v = min(int(v), 128)