0

I am building a Music Player with the NAudio Library. Now it's time to build a clock for the current Time.

Actually my way of doing this, is by binding the Text Property of a Textblock to the CurrentPosition Property (which gives me, who would have given a thought to this, a TimeSpan object consisting of the current position). I want to convert it through an IValueConverter. Because the library doesn't fires a PropertyChanged Event Iam not really sure, what I can do now.

Thank you in advance.

trialgod
  • 302
  • 1
  • 15

1 Answers1

0

CurrentTime will be continually advancing if you are playing audio, depending on the size of your buffers. It is better to simply poll it a few times a second which will be more than enough. You can either have a timer on your GUI that updates the value, or if you are using MVVM, a timer in your ViewModel that periodically fires a PropertyChanged while you are playing.

Mark Heath
  • 48,273
  • 29
  • 137
  • 194