Handmade Hero»Forums»Code
14 posts
Handling wrapping in the mixer code
Edited by Terans on Reason: Initial post
Hi, in the audio mixer, we do a linear interpolation between two samples, but how does Casey handles the fact that we might read one index past the end of the buffer? In this case, we should rather lerp between buffer[size - 1] and buffer[0], and not buffer[size - 1] and buffer[size]?
It's on the line 231 in handmade_audio.cpp
Mārtiņš Možeiko
2237 posts / 1 project
Handling wrapping in the mixer code
That is handled in asset builder - when it parses wave file and prepares sound asset for runtime, it pads with extra zeroes: https://guide.handmadehero.org/code/day145/#990