title: NAudio: How can I get an event that tells me that the MP3 file reached the end?
body: <p>I tried to use this:</p>
  
  <pre><code>private void CreateDevice()
  {
      _playbackDevice = new WaveOut();
      _playbackDevice.PlaybackStopped += PlaybackDevicePlaybackStopped;
  }
  
  void PlaybackDevicePlaybackStopped(object sender, EventArgs e)
  {
      if (OnPlaybackStopped != null)
      {
          OnPlaybackStopped(this, e);
      }
  }
  </code></pre>
  
  <p>But it never invoked.</p>
  
  <p>Then I tried to use the PlaybackState by polling the property with a timer:</p>
  
  <pre><code>public PlaybackState PlaybackState
  {
      get
      {
          if (_playbackDevice == null)
              return default(PlaybackState);
  
          return _playbackDevice.PlaybackState;
      }
  }
  </code></pre>
  
  <p>But when the song ends it does not change to "stopped". But when I call manually Stop it changes correctly.</p>
  
  <p>Can someone help me?</p>
  
  <p>There seems to be a bug ... <a href="http://naudio.codeplex.com/WorkItem/View.aspx?WorkItemId=10726" rel="nofollow noreferrer">http://naudio.codeplex.com/WorkItem/View.aspx?WorkItemId=10726</a></p>