I wrote some code that sets new playlist each time at fixed intervals and then plays it, but after the first play, it doesn't play anymore. I still get 55 printed in the console, so my code is running, it's just the player stops working.
if (AlarmSystem.OutputDevice.PlaybackState != PlaybackState.Playing)
{
var playlist = new ConcatenatingSampleProvider(AlarmSystem.GetTriggeredAlarmsPlaylist());
AlarmSystem.OutputDevice.Init(playlist);
AlarmSystem.OutputDevice.Play();
Console.WriteLine(55);
}
I checked the audio playback also seems to be interrupted even though I am checking for PlaybackState and only run the above code if it's not PlaybackState.Playing.
I tried calling Dispose before also and even recreating OutputDevice but it doesn't play again.
In my code I am getting the new playlist so I can play that one after the old one finishes.