mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
server: update to have 0-128 range, feedback from jose
This commit is contained in:
@@ -56,8 +56,8 @@ def get_audio_waveform(path: Path | str, segments_count: int = 256) -> list[int]
|
||||
|
||||
volumes = volumes[:current_chunk_idx]
|
||||
|
||||
# normalize the volumes 0-2**8
|
||||
volumes = volumes * (2**8 - 1) / volumes.max()
|
||||
# normalize the volumes 0-128
|
||||
volumes = volumes * 128 / volumes.max()
|
||||
|
||||
return volumes.astype("uint8").tolist()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user