This project has moved. For the latest updates, please go here.

Implement track list function. How to auto play next track?

Feb 5, 2014 at 8:49 AM
Hi there,
NAudio is a really great library and I like to use it a lot but something I'm trying to implement refuses to work all the time.
I have some sort of Mp3Player that contains a list of tracks.
Everything works fine so far but I would like to play the next track if another one finished playback.
My approach was to handle WaveOut.PlaybackStopped and dispose my WaveOut and MediaFoundationReader instance and just reinitialize them.
Unfortunately that did not work.
While debugging I noticed that the debugger just gets to WaveOut.Dispose() and then continues to execute. I don't know if my WaveOut actually got disposed or not, the debugger just continues execution.

Am I doing something wrong? How can I implement the wanted functionality?
I tried to look into NAudio's source code to check if there is anything I missed but either my skills are to bad to understand what is really happening or there isn't anything I'm doing wrong.

Thanks in advance :)
Feb 6, 2014 at 8:21 AM
Yes you need to listen for the PlaybackStopped event, then clean up, and play the next song in your list.