public MyBufferedSampleProvider(WaveFormat waveFormat)
 {
     this.waveFormat     = waveFormat;
     this.BufferLength   = (waveFormat.AverageBytesPerSecond / 4) * 5;
     this.circularBuffer = new MyCircularBuffer(this.BufferLength);
     this.ReadFully      = true;
     FloatPerRead        = waveFormat.AverageBytesPerSecond / 20;
 }
 public void AddSamples(float[] buffer, int offset, int count)
 {
     if (this.circularBuffer == null)
     {
         this.circularBuffer = new MyCircularBuffer(this.BufferLength);
     }
     circularBuffer.Write(buffer, offset, count);
     if (circularBuffer.Count > FloatPerRead * 5)
     {
         ToRead = true;
     }
 }