rackfx/Node-WAV-File-Info

Length in ms calculated incorrectly

Opened this issue · 2 comments

Hi there, I noticed that the length in ms is calculated incorrectly in this library, the issue seems to be not subtracting the header bytes from the chunk_size.
So all you need to do is: info.header.chunk_size - 36 before dividing it by num_channels and bits_per_sample and the result will be correct.

Thanks.

Thanks for reporting this, I will take a look.

Hello,
Thanks for your lib.
I used it as start for an app I'm working on.

I'm working on samplers wav files. The wav files aren't that standard, there is several subchunks (not the same number on each wav) so the header size isn't constant like it should...
So I adapt your code like that (maybe it can help to find a more universal reader):

wav.txt

I skiped the check routine for now, but with that you can handle multi subchunk or whatever subchuck size files.

Regards,
eKo