urinieto / msaf

Music Structure Analysis Framework
MIT License
478 stars 79 forks source link

Save sonified audio at 16-bit instead of 64-bit #141

Closed carlthome closed 9 months ago

carlthome commented 9 months ago

Minor thing but with sonify_bounds set, the extra output audio file is really large (a 5 minute music track is around 60 MB even at only 22.05 kHz).

Reason is scipy.io.wavfile.write respects the dtype of its input array, which is always doubles in NumPy when left unspecified.

This PR adds the bit depth conversion from scipy.io.wavfile.write's docstring (60 MB -> 15 MB).

urinieto commented 9 months ago

Nice catch! Merging it...