Music corrupts if Win11 audio output is changed during playback
https://github.com/user-attachments/assets/2623da89-a145-4b22-bc53-50c29b15915f
On Win11 the shortcut for audio output device "on the fly" changing is CTRL+WIN+V. It's an overlay that's sadly not captured in the video but here's a screenshot from reddit:
The issue is also present in TR1X.
@Richard-L can you test if it's the same with FMVs, which use a different audio decoding process?
Can't get the error in the FMVs when starting TR2 despite multiple switching back and forth. But after the main menu music will immediately have the error.
Seems like the FMV audio decoding is fine 👌
Interesting. I just checked my game, and it seems only music files are affected (ex- title music, cutscenes). FMVs and game sounds (ex- pistol gun shots) play fine.
Audio streams need to renegotiate the channel layout once the device changes. The FMV code which is originally based off ffplay.c supports this, but music streams do not - I never included this logic, foolishly believing it's such a corner case that it will be irrelevant to us.