liamappelbe / wav

Dart package for reading and writing wav files
Apache License 2.0
18 stars 5 forks source link

FormatException (FormatException: WAV is corrupted, or not a WAV file.) #16

Open Effeo opened 2 weeks ago

Effeo commented 2 weeks ago

I have a file audio that is loaded on all the devices except for some (eg. samsung s23) the error is FormatException (FormatException: WAV is corrupted, or not a WAV file.). I added the wav file as attachment IT_DECL_02S01.zip

liamappelbe commented 1 week ago

Can you tell me which devices it works on and which it doesn't? List as many devices as possible. It could be something to do with CPU architecture (samsung s23 appears to be arm64), but I can't tell without more information.

Also, is it just this wav file that has the bug? Have you tried other wavs?

liamappelbe commented 1 week ago

That wav loads fine on my x64 linux laptop, so it's not a word size issue. It's probably not a byte order issue either, because my laptop is little-endian, and so is the samsung s23.

Effeo commented 1 week ago

Can you tell me which devices it works on and which it doesn't? List as many devices as possible. It could be something to do with CPU architecture (samsung s23 appears to be arm64), but I can't tell without more information.

It works on the vast majority of devices, I tested on some onePlus, some Oppos and some Xiaomi, and on them it works. Only S23 is having those troubles.

Also, is it just this wav file that has the bug? Have you tried other wavs?

Yes other files are loading correctly on the S23, this is the only file that's not loading on Samsung S23.

liamappelbe commented 1 week ago

That is super weird. Since it's so device specific there's not much I can do about it on my end as I don't have an S23. This package is pretty simple though, so if you want to try debugging it yourself you can probably figure out the issue. The parsing code is all contained in this function, and is only about 30 lines.

Can you post the stack trace? That will at least tell us which line of the parsing function is failing. Then we can try and figure out exactly what bytes of the wav file are failing to parse, and maybe figure out why it's device specific.