I'm programming a game and using NAudio with WaveOut. The sound is played when a collision occurs. The problem is the sound plays some times and after a few seconds if the collision happens again, the sound isn't played. I'm using this code.
WaveOut device = new WaveOut();
WaveStream source = new Mp3FileReader("hit.mp3");
device.Init(source);
And to play it,
source.Position = 0;
source.CurrentTime = TimeSpan.Zero;
device.Play();
Am I forgetting anything?
Thanks.