NAudio
NAudio copied to clipboard
While using Audio from URL my entire WinForm disappears
I'm using this code to test it out, the code works but this makes my WinForm disappear, while (wo.PlaybackState == PlaybackState.Playing)
this line does the trick.
using(var mf = new MediaFoundationReader(url))
using(var wo = new WaveOutEvent())
{
wo.Init(mf);
wo.Play();
while (wo.PlaybackState == PlaybackState.Playing)
{
Thread.Sleep(1000);
}
}