I'm thinking, though, whether this works now or not, it might be better to always open the audio device at CD-ROM quality if the app asks for less, so there's never a scenario where you have to close the audio device and reopen it to accommodate things. You just have to make sure the SDL_AudioStream manages conversion, which we already have to do anyhow.
This would eliminate the gap in audio you hear in that patched loopwave.c, where it has to dump the audio device after 5 seconds to handle CD playback, and also a FIXME that I handwaved away about what to do if the reopening fails and something that was working fine is now screwed.
Originally posted by @icculus in https://github.com/libsdl-org/sdl12-compat/issues/176#issuecomment-1235604334