gpt4 book ai didi

C# WMPLib mp3 的持续时间

转载 作者:太空宇宙 更新时间:2023-11-03 14:33:48 30 4
gpt4 key购买 nike

我正在使用 WMPLib 在 C# 中制作一个简单的 mp3 播放器。我快完成了,但我还想做一件事。

我想知道这首歌走了多远,还想知道这首歌还剩多少。使用例如进度条。

谢谢

亚当

最佳答案

private void timer1_Tick(object sender, EventArgs e)
{
double percent = 0;
if (mp.Length != 0)
percent = ((double) wplayer.controls.currentPosition / wplayer.controls.currentItem.duration);
progressBar1.Value = (int)(percent * progressBar1.Maximum);
}

关于C# WMPLib mp3 的持续时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1876224/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com