NAudio icon indicating copy to clipboard operation
NAudio copied to clipboard

crash when NAudio.Wave.DirectSoundOut.Dispose

Open xiejiang2014 opened this issue 3 years ago • 1 comments

.net 5 NAudio 2.0.1 Windows 10 10.0.17134

.net 5+ doesn't seem to support Thread.Abort() ref:thread-abort-obsolete

Detail:

Exception Type: System.PlatformNotSupportedException

Message: Thread abort is not supported on this platform.

StackTrace: at System.Threading.Thread.Abort() at NAudio.Wave.DirectSoundOut.Stop() at NAudio.Wave.DirectSoundOut.Dispose()

xiejiang2014 avatar Apr 15 '22 13:04 xiejiang2014

it's hard to reproduce as the Thread.Abort only gets called in an error scenario. I'll consider removing it. But really I'd recommend using WasapiOut or WaveOutEvent going forwards unless there is some reason you really need Direct Sound

markheath avatar May 20 '22 17:05 markheath