如何使用 winmm.dll 确定歌曲的长度?
我已经P/Invoked the mciSendString method from WinMM.dll:
[DllImport("winmm.dll")]
private static extern long mciSendString(string strCommand, StringBuilder strReturn,
int iReturnLength, IntPtr hwndCallback);
我可以播放、暂停和停止歌曲(我还可以打开/关闭 CD 驱动器,但这并不重要)。 现在我希望我的用户能够跳到歌曲中的某个部分(例如 1:21)。 我查看了 seek 函数文档除了我不知道一首歌有多长之外,它看起来很简单。 WinMM 中是否存在执行此操作的命令/方法?
I've P/Invoked the mciSendString method from WinMM.dll:
[DllImport("winmm.dll")]
private static extern long mciSendString(string strCommand, StringBuilder strReturn,
int iReturnLength, IntPtr hwndCallback);
I can play, pause, and stop songs (I can also open/close the CD drive, but that's not important). Now I want my user to be able to skip to a certain part in a song (e.g. 1:21). I've looked at the seek functions documentation and it seems pretty staightforward except that I can't figure out how long a song is. Does a command/method exist to do this in WinMM?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
大概是这样的:
It would probably be something like this: