This project has moved and is read-only. For the latest updates, please go here.

Sequentially playing problem

Apr 28, 2011 at 7:16 AM

Having used NAudioDemo, I have written NAudioPlayer class which plays back audio file by passing NAudioPlayer::Play(string filename). 

Then I have written another class where I use NAudioPlayer instance and timer for checking if playing stopped and start new playing. So, I have sequentially playing.

When I start application it playing good during some period of time and then hanging.

I have found that it goes to WaveOutBuffer::WriteToWaveOut, but does not go through lock(waveOutLock). 

Could you help me?


Apr 28, 2011 at 12:57 PM

I fixed this problem by putting instead of lock operator Monitor.TryEnter

Apr 29, 2011 at 9:36 AM

when it hangs, what is happening on other threads? Are you using the latest NAudio code?

May 12, 2011 at 2:20 PM

I used rev. 72238.

Other threads worked normally.

May 12, 2011 at 3:04 PM

what I mean is, in the Visual Studio debugger, you can look at the threads window. that will show you which other thread has taken the waveOutLock and you can see what waveOut API it is hanging on.