Scale by max value

Scale by max value to allow for processing 24- and 32-bit wavs
This commit is contained in:
Jasper 2022-12-16 22:12:39 -06:00 committed by GitHub
parent 1c5caf77ac
commit 66dbdb16ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -94,8 +94,11 @@ def image_from_spectrogram(
# Apply the power curve
data = np.power(spectrogram, power_for_image)
# Rescale to 0-1
data = data / np.max(data)
# Rescale to 0-255
data = data * 255 / max_volume
data = data * 255
# Invert
data = 255 - data