What I'm trying to do is play a music file for a specified duration, and then stop playing. However, the whole music file is being played. I cannot use the 'PlaySync()' method as I cannot have the thread being blocked.
maybe something like this
Task.Factory.StartNew(() =>
{
var player = new SoundPlayer();
player.SoundLocation = "myfile";
player.Play();
Thread.Sleep(duration)
player.Stop();
});