C#:AxWMPLib - 播放歌曲的一部分

发布于 2024-07-28 22:24:29 字数 188 浏览 3 评论 0原文

我正在尝试使用 AxWMPLib COM 控件在 WinForms C# 应用程序中播放歌曲。 但是,我只想播放该歌曲的特定 30 秒区域。 到目前为止,我可以从 30 秒区域的开头开始播放曲目(使用 Ctrlcontrols.currentPosition 成员),但我无法指定结束时间。

只播放这首曲目 30 秒的最佳方法是什么?

I'm trying to play a song in a WinForms C# application using the AxWMPLib COM control. However, I only want to play a specific 30 second region of that song. So far I can play the track from the beginning of that 30 second region (using the Ctrlcontrols.currentPosition member), but I have no way of specifying the end time.

What's the best way to go about playing only 30 seconds of this track?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

⒈起吃苦の倖褔 2024-08-04 22:24:29

我不知道有什么方法可以完全在 WMP 控件中做到这一点。

另一种选择,这可能不精确,但您可以尝试创建一个具有 30 秒滴答时间的计时器,然后在调用 axWmp.Play(...) 时启动该计时器。 当计时器计时时,调用 axWmp.Stop()。

I don't know of a way to do this entirely in the WMP control.

An alternative, and this may not be precise, but you could try creating a Timer with a 30 second tick time, then start that timer when you call axWmp.Play(...). When the timer ticks, call axWmp.Stop().

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文