Closed vkahl closed 1 year ago
Thanks.
I've seen this before but I thought I had fixed it. Will investigate.
Hey @vkahl , I've pushed the fix, thankfully very simple and straightforward. Thanks for catching it. I've also published V1.1.1 to crates.io
I've included a specific test case for this. I generated a random wav file, encoded as s161e and with 2048 samples. Then I open it as an f32 and check the number of samples is correct.
Awesome, thanks a lot for the quick response and fix!
Reproducible example:
I guess in the
n_samples
function, the total size of the data chunk is divided by the size of one sample after the conversion tof32
. Since anf32
takes up twice as many bytes asi16
, the outcome is half of the actual number of samples in the file.