steelegbr / wave-chunk-parser

Parses wave file chunks.
Apache License 2.0
9 stars 4 forks source link

"ValueError: buffer size must be a multiple of element size" with some wave files #202

Open adriananders opened 1 month ago

adriananders commented 1 month ago

ss.wav.zip

On M1 MacOS 14.6, Python 3.11, wave-chunk-parser 1.5.0, the attached wave file does not parse, leading to the following error:

ValueError: buffer size must be a multiple of element size

On this line.

Can you take a quick look to see if you can reproduce?

adriananders commented 1 month ago

This fixes the issue: samples = np.frombuffer( raw[0:(len(raw) // 3) * 3], dtype=np.dtype("V3"), )