将AxWMPLib添加到VB/C#项目中.将AxWindowsMediaPlayer控件添加到表单中.
使用以下方法访问播放速率:
AxWindowsMediaPlayer1.URL = "e:\song.mp3"
AxWindowsMediaPlayer1.Ctlcontrols.play()
AxWindowsMediaPlayer1.settings.rate = 0.5
Run Code Online (Sandbox Code Playgroud)
*请注意,根据媒体类型,可能无法始终提供费率.更安全的访问速率方法如下:
If (player.settings.isAvailable("Rate")) Then
player.settings.rate = 0.5
End If
Run Code Online (Sandbox Code Playgroud)
如果这不是您正在寻找的,那么也存在MediaPlayer COM对象.我没有彻底调查,但intellisense产生了:
Dim mpMediaPlayer As New MediaPlayer.MediaPlayer
mpMediaPlayer.FileName = "e:\song.mp3"
mpMediaPlayer.Rate = 0.5
mpMediaPlayer.Play()
Run Code Online (Sandbox Code Playgroud)
希望有所帮助.