Handmade Hero»Forums»Code
Mox
32 posts
Day 152: SampleAt bug in LoadSound
In the calculations for the Sample pointers for each channel, the int16* SampleAt is incremented by ChannelSize, which itself is already mulitplied by sizeof(int16). So either SampleAt should be incremented by SampleCount, or it should become a u8*.

I know this only messes up the second channel which is not used right now. But it might come up in the future.
This bug was also introduced around the time that the sound pop at the end of the projectile effect was noticed, but I don't think this is related. (Though it could be)

Cheers, Mox
Casey Muratori
801 posts / 1 project
Casey Muratori is a programmer at Molly Rocket on the game 1935 and is the host of the educational programming series Handmade Hero.
Day 152: SampleAt bug in LoadSound
Thanks man! We have to take a spin through that code because we've got other issues too, so I will try to make an episode sometime soon where we clean up the sound code.

- Casey