What's the best way to deal with a device that fails and disappears? For example if a device is unplugged whilst audio is outputting to it, how to move the audio to the default device?
What I've tried is creating a mixer to point to an output device and then opening a file as a decode file and attaching this to the mixer.
This all works fine and plays, and when I unplug the audio device it's outputting to and then I reconnect it, I can't then get the mixer to be assigned to the original device. It just doesn't work.
Ideally if a device is unplugged, even if there is no other device, the audio would still play, but obviously not being output, and then when the device is plugged in again then it would resume on that device.
For example Firefox does this. If you're on something like YouTube and you're watching a video, then you unplug the audio device, the sound is redirected to the default device. When you plug the device back in then it automatically goes back to that device.
Is this even possible?