My program uses Naudio.Wave.WaveOut to play out audio on a USB audio device. If the USB audio device is removed during playback to GUI playback panel is no longer updated. Any interaction with the playback panel result in the whole program to freeze. My approach was to move all the Naudio.Wave.WaveOut functionality into its own thread (BackgroundWorker to be presice) so that if playback bombs out it will not influence the GUI thread in a negative manner. However, try as I may (wasting almost 2 days) I just could not get audio to play out using Naudio.Wave.WaveOut from a non GUI thread. I also tried WaveOutEvent without luck. All I got was one callback with stopped state after issuing play.
Is there something fundamental about WaveOut and WaveOutEvent that it will only work in a GUI thread? Also I want to add that WaveOut is way more robust than WaveOutEvent if you really hammer a play/pause button.