I'm playing mp3 file from Internet using BufferedWaveProvider in NAudio library. How can I get information about the current positi开发者_Go百科on and the length of the track? Is it possible?
You can calculate the current position using the number of bytes that have been read from the Read method of your BufferedWaveProvider, and use the WaveFormat's AverageBytesPerSecond property to turn this into a TimeSpan.
As for the duration of the MP3 file, unfortunately this will be unknown until streaming has finished.
精彩评论