开发者

naudio streaming position

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜