Quantcast
Channel: NAudio
Viewing all articles
Browse latest Browse all 5831

New Post: NAudio and GetPosition() = 105840

$
0
0
OK, try this:
  • 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.
I know this is different than the console code, but it should sidestep any message pumping issues that might be causing the behavior.

One side note: NVorbis is pretty fast, but may not be fast enough to decode in real-time on some slower machines.

Viewing all articles
Browse latest Browse all 5831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>