So I have a USB audio decoder attached to my PC. I use it when nobody else is in the room watching TV or similar. Typically I will unplug it when my noises would be disturbing others, and switch to my earphones. In pretty-much everything, this works. Except when I'm using SFML.
When I unplug the device, I immediately get this message:
"AL lib: (EE) MMDevApiProc: Failed to get padding: 0x88890004"
Some time later (seems to be a few seconds after I try to play a previously unplayed sound) my code crashes and I get this during a call to window.DispatchEvents:
Exception thrown at 0x00007FFC06F679A3 (KernelBase.dll) in GameCore.exe: 0xC0000005: Access violation reading location 0x0000000000000004.
So... how can I:
- Detect the removal of a device (or, preferably, detect the change of default device - I'd like it to work when I plug the USB amplifier in, too)
- Pause all sounds
- Change devices (reset audio, whatever is required)
- Resume all sounds
Any suggestions gratefully received!
Many thanks