访问 Windows Media Player 的播放速度控件

发布于 2024-07-19 01:55:22 字数 201 浏览 3 评论 0原文

有没有办法在 dotnet 应用程序中访问 WMP10+ 的播放速度控件?

有关播放控制信息的用户级别信息

Is there a way to access WMP10+'s playback speed controls in a dotnet app?

User level information on the Playback control information

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

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

发布评论

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

评论(2

客…行舟 2024-07-26 01:55:22

AxWMPLib 添加到您的 VB/C# 项目中。
AxWindowsMediaPlayer 控件添加到您的表单中。

使用以下方法访问播放速率:

AxWindowsMediaPlayer1.URL = "e:\song.mp3"
AxWindowsMediaPlayer1.Ctlcontrols.play()
AxWindowsMediaPlayer1.settings.rate = 0.5

*请注意,根据媒体类型,速率可能并不总是可用。 一种更安全的访问速率的方法如下所示:

If (player.settings.isAvailable("Rate")) Then
    player.settings.rate = 0.5
End If

如果这不是您正在寻找的,那么还存在 MediaPlayer COM 对象。 我没有彻底调查它,但智能感知产生了:

Dim mpMediaPlayer As New MediaPlayer.MediaPlayer
mpMediaPlayer.FileName = "e:\song.mp3"
mpMediaPlayer.Rate = 0.5
mpMediaPlayer.Play()

希望有帮助。

Add the AxWMPLib to your VB/C# project.
Add an AxWindowsMediaPlayer control to your form.

Use the following method to access playback rate:

AxWindowsMediaPlayer1.URL = "e:\song.mp3"
AxWindowsMediaPlayer1.Ctlcontrols.play()
AxWindowsMediaPlayer1.settings.rate = 0.5

*Note that rate may not always be available depending on the media type. A safer method of accessing rate would look like:

If (player.settings.isAvailable("Rate")) Then
    player.settings.rate = 0.5
End If

If that isn't what you're looking for, there also exists the MediaPlayer COM object. I didn't investigate it thoroughly, but intellisense yielded:

Dim mpMediaPlayer As New MediaPlayer.MediaPlayer
mpMediaPlayer.FileName = "e:\song.mp3"
mpMediaPlayer.Rate = 0.5
mpMediaPlayer.Play()

Hope that helps.

若无相欠,怎会相见 2024-07-26 01:55:22

如果您使用 MediaElement 对象,我建议调整 SpeedRatio 属性。 以下是来自 Microsoft 的示例

从您的评论来看,听起来 SpeedRatio 是正确的选择。 因为它可以让你调整播放速度。 MediaElement 或 MediaPlayer 基本上只是一个 Windows Media Player。

If you are using a MediaElement object, I would suggest adjusting the SpeedRatio property. Here is an example from Microsoft.

From your comment, it sounds like the SpeedRatio is the way to go. Because it allows you to adjust the playback speed. The MediaElement or MediaPlayer is basically just a Windows Media Player.

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