Possible bug with WAV loader?

Pixilang programming language
Post Reply
vantjac
Posts: 13
Joined: Sun May 12, 2019 7:41 am

Possible bug with WAV loader?

Post by vantjac »

I'm not sure whether to post this in the Pixilang forum or the SunVox forum since I have the same problem in both. I noticed that the Pixilang WAV loader can also load sample loop points, stored in the "loop_start", "loop_len", and "loop_type" properties. However, this only seems to work correctly with about half of my samples. For the other half it doesn't detect the loop points at all.

I've attached two examples of samples. One loads the sample loop points correctly, the other doesn't. Both load correctly in OpenMPT and Renoise.

The pattern I noticed so far is that WAVs with an odd number of bytes of sample data don't load correctly, and WAVs with an even number of bytes do. This is just a guess, but it might have something to do with word-alignment in the RIFF format? I had to deal with a similar issue when writing my own WAV loader -- chunks are always word-aligned.
Attachments
samples.zip
(19.51 KiB) Downloaded 109 times
User avatar
NightRadio
Site Admin
Posts: 3941
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: Possible bug with WAV loader?

Post by NightRadio »

WAVs with an odd number of bytes of sample data don't load correctly
That's the way it is, you're right. Thank you!
Loop info loading code does not work correctly with odd number of bytes of sample data.
This bug is present in both Pixilang and SunVox.
Will be fixed in the updates.
Post Reply