private void wc_Sample(object sender, SampleEventArgs e)
{
if (wc == null) return;
if (wc.CurrentTime.TotalSeconds != currentTime)
{
currentTime = wc.CurrentTime.TotalSeconds;
NotifyPropertyChanged("CurrentTime");
NotifyPropertyChanged("BufferPortion");
pos = lmem.Position;
NotifyPropertyChanged("Position");
}
if (lmem.Position == lmem.Length) { this.stop(); return; }
long myBufferSize = 20480;
if ((!BufferingState) && (localstream.Position != rsc.Tag.FileSize) && ((localstream.Position - lmem.Position) < myBufferSize))
{
Console.WriteLine("Paused ... waiting!");
BufferingState = true;
this.pause();
localstream.WaitForMore();
}
}