csteinmetz1 / pyloudnorm

Flexible audio loudness meter in Python with implementation of ITU-R BS.1770-4 loudness algorithm
https://www.christiansteinmetz.com/projects-blog/pyloudnorm
MIT License
621 stars 55 forks source link

Does util.py check for -1/+1? #57

Closed smros closed 9 months ago

smros commented 9 months ago

I wanted to verify that input audio data should be scaled between -1 and +1 and saw the "util.py" function has some tests for the input data. The tree of tests though, doesn't check for -1/+1? Unless the test for the "floating" class does that?

smros commented 9 months ago

I may have answered my question. When I use scipy.io to read in a wav file, it comes in from the file in the format it was built in which could use integers. When I try "soundfile" it looks like it converts it to floating point, using the max of the type, and will be between +/- 1.