Handmade Hero»Forums»Code
Andy
13 posts
Day 21 Audio Hiccup - Please Help!
Hi there,
I've been trying to follow along at home however as I'm coding along with day 21 I noticed that once Casey reaches the point where he can compile and run again (30:25 roughly) the audio has some artifacts in it, every few seconds I can hear a bump in the sound. I finished off the rest of the days code to see if it would be fixed by the end, but as of the end of day 21 my audio artifact is still there. Did anyone encounter this? I'm stuck, I can't figure out why this is happening. Any help would be very much appreciated. Thank you!
Andy
13 posts
Day 21 Audio Hiccup - Please Help!
Ps, I noticed the hiccup happens when the code is being unloaded and reloaded. It may be that the bug exists in Casey's version, but he doesn't let the audio run long enough for me to tell.
Juan Felipe Garcia Catalan
7 posts
Day 21 Audio Hiccup - Please Help!
I have not checked, but I vaguely recall that the float variable representing time that was fed to the wave calculation would lose precision quite fast, causing sound artifacts, and that wasn't solved until a later Q&A, possibly just capping it to some interval or something similar.
But as I said that's just a vague recollection.
Andy
13 posts
Day 21 Audio Hiccup - Please Help!
Thanks for the reply! I think what you're remembering is probably the tSine value that was losing precision and causing the tone to wander. That was actually fixed at the end of day 20.
It occurs to me that maybe this problem doesn't matter. The hiccup only happens when I reload code, and that will only happen when I'm coding or debugging, not running the actual game.
Oliver Marsh
177 posts / 1 project
A budding game developer and programmer
Day 21 Audio Hiccup - Please Help!
hey Andynonomous,
not sure if i can help, we did move away from the sound around this time and haven't come back to it yet. Could it be the frame rate dropped when you uploaded and reloaded?