Fix bug with 16-bit wav files

They were interpreted as 24-bit making the division with maximum value overflow