OK, try this:
One side note: NVorbis is pretty fast, but may not be fast enough to decode in real-time on some slower machines.
- Make vor and wav member variables on your UI class in the codebehind
- In your "Play" button's click handler instantiate vor and wav, init wav, add a handler for wav.PlaybackStopped, then start playback. Do NOT use a "using" statement.
- In the PlaybackStopped handler, put your cleanup code (wav.Dispose(); vor.Dispose();)
-
Add a "Stop" button and in its click handler call wav.Stop() if wav is currently playing.
One side note: NVorbis is pretty fast, but may not be fast enough to decode in real-time on some slower machines.