private void inputStream_Sample(object sender, SampleEventArgs e) { visualizer.Add(e.Left, e.Right); long repeatStartPosition = (long)((SelectionBegin.TotalSeconds / this.activeStream.TotalTime.TotalSeconds) * this.activeStream.Length); long repeatStopPosition = (long)((SelectionEnd.TotalSeconds / this.activeStream.TotalTime.TotalSeconds) * this.activeStream.Length); if (((SelectionEnd - SelectionBegin) >= TimeSpan.FromMilliseconds(200)) && this.activeStream.Position >= repeatStopPosition) // 200 = repeatthreshhold { visualizer.Clear(); this.activeStream.Position = repeatStartPosition; } }
private void waveStream_Sample(object sender, SampleEventArgs e) { waveFormVisualizer.Add(e.Left, e.Right); }