title: NAudio PlaybackState never stops?
body: <p>I'm using <strong>NAudio</strong> to create a simple audio player but I can't find a solution that could change the <code>PlaybackState</code> of my <code>WaveOut</code> stream to "Stopped" and consequently fire the <code>PlaybackState</code> event.</p>
  
  <p>I did it as shown below:</p>
  
  <pre><code>private BlockAlignReductionStream stream = null;
  
  private NAudio.Wave.WaveOut output = null;
  
  private void Add_to_stream()
          {
  
              string[] files = Directory.GetFiles(Settings.Default.m + "\\","*"+selected_music+"*");
  
              if (files[0].EndsWith(".mp3"))
              {
                  NAudio.Wave.Mp3FileReader mp3fr = new NAudio.Wave.Mp3FileReader(Settings.Default.m + "\\" + selected_music + ".mp3");
                  var pcm = NAudio.Wave.WaveFormatConversionStream.CreatePcmStream(mp3fr);
                  stream = new NAudio.Wave.BlockAlignReductionStream(pcm);
  
              }
              else if (files[0].EndsWith(".wav"))
              {
                  NAudio.Wave.WaveFileReader wavfr = new NAudio.Wave.WaveFileReader(Settings.Default.m + "\\" + selected_music + ".wav");
                  var pcm = new NAudio.Wave.WaveChannel32(wavfr);
                  pcm.PadWithZeroes = false;
                  stream = new NAudio.Wave.BlockAlignReductionStream(pcm);
              }
              else throw new InvalidOperationException("file type is not supported.");
  
              output = new NAudio.Wave.WaveOut();
              output.Init(stream);
  
          }
  </code></pre>
  
  <p>Originally, I was using  <a href="http://naudio.codeplex.com/SourceControl/changeset/view/e43c857bbbe2#NAudio/Wave/WaveOutputs/DirectSoundOut.cs" rel="nofollow">DirectSoundOut</a> instead of <a href="http://naudio.codeplex.com/SourceControl/changeset/view/e43c857bbbe2#NAudio/Wave/WaveOutputs/WaveOut.cs" rel="nofollow">WaveOut</a> class and I was being able to overcome this problem, but that one doesn't support Resuming.</p>
  
  <p>I know that there are lot of people who has already faced this problem, but is there an alternative for both things (Resuming and firing PlaybackState)?</p>