OK, I have done this, but this method is rather slow. While playing, I can hear something like ticks. This is my code.
(These ticks are only when I draw the line. The line is drawn on WaveViewer. In other words WaveViewer is parent of the line).
//indicatorTimer is a dispatcherTimer with interval set to 100 //indicator is Microsoft.VisualBasic.PowerPacks.LineShape private void indicatorTimer_Tick(object sender, EventArgs args) { if (indicator.Visible) { int ms = (waveStream.CurrentTime.Minutes * 60 * 1000) + (waveStream.CurrentTime.Seconds * 1000) + waveStream.CurrentTime.Milliseconds; int x = (ms * (waveStream.WaveFormat.SampleRate / 1000)) / samplesPerPixel; DrawIndicator(x); lastX = x; } if (OnPlayProgress != null) OnPlayProgress(this, waveStream.CurrentTime); if (waveStream.TotalTime == waveStream.CurrentTime) indicatorTimer.Stop(); } private void DrawIndicator(int x) { indicator.X1 = x; indicator.X2 = x; } //in OnPlayProgressEvent I have only one line of code: timeLabel.Text = String.Format("{0:00}:{1:00}", currentTime.Minutes, currentTime.Seconds);