I won't try to recreate a rare bug, it's rare so just avoid it that's all. There are known issues in sound like changing the sample rate in a game which use fm music after the game has started will produce bad sound, the known workaround is just to quit when you change the sample rate. Yeah I know it's not super ideal, now if someone wants to send patches to improve all this, I'll accept them !
It's assumed people can setup their sound once and then keep the settings for normal play.
A program which works in all conditions is a crazy thing, that's something you learn quickly when you learn how to program, even if you try to do it with some sample code it can quickly become crazy. Now for some safe environments where it's a necessity, people try to keep programs small to avoid that things become too crazy. For raine it's already very big, you have to be a minimum reasonable about what to do in this case, it's already working as well as possible with some pitfalls which can be easily avoided.