Where is the Read call? Keep in mind, that you have to read from the NotifyingSampleProvider and not from the AudioFileReader.
Your approach is a good start, but I wouldn´t recommend you to fire an event on each sample. Better check if the time is greater or equal of the time you want to wait and only then raise the event.
The reason your code fails I believe, could have several reasons:
1) you fire events with an samplerate of 44100 and stereo channel count of 2 = 88200 times per second.
Not very performant I think, the frequent event processing might be an issue.
2) you probably have the false configuration for your WaveOut object. I recommend 150 (ms) latency and 3 buffers, what gave me the closest results for my media player so far. With this configuration the Read method of the sampleprovider requests 4410 samples, which is enough to display an fft with 4096 samples in real time.
-> So it really depends on your application. If you want a small duration for more precision the buffers would automatically have to be smaller, as the read method anyway reads a full package of samples into your buffer. But for low latency beyond 75ms you should use Asio or DirectSound, as the WaveOut crackles then (with my computer).
Your approach is a good start, but I wouldn´t recommend you to fire an event on each sample. Better check if the time is greater or equal of the time you want to wait and only then raise the event.
The reason your code fails I believe, could have several reasons:
1) you fire events with an samplerate of 44100 and stereo channel count of 2 = 88200 times per second.
Not very performant I think, the frequent event processing might be an issue.
2) you probably have the false configuration for your WaveOut object. I recommend 150 (ms) latency and 3 buffers, what gave me the closest results for my media player so far. With this configuration the Read method of the sampleprovider requests 4410 samples, which is enough to display an fft with 4096 samples in real time.
-> So it really depends on your application. If you want a small duration for more precision the buffers would automatically have to be smaller, as the read method anyway reads a full package of samples into your buffer. But for low latency beyond 75ms you should use Asio or DirectSound, as the WaveOut crackles then (with my computer).