The sound code appears to generate samples based on the assumption the the game is running at 60fps. Any games that run at less than 60fps don't generate enough samples and therefore the gaps in the sound. I tried adding some resampling code to increase the buffer size before it was passed to the main ring buffer but it didn't improve the issue, although this could be down the the resampling code itself. I need to find some decent integer resampling code to try out, I looked at libresample but it uses floats and is overly complicated for my purposes.
I will try and find some time to take a second look, however sound programming is not my best area, the sources are available on github if anyone wants to take a look and suggest anything.