Accessing Windows Media Player's Playback Speed controls

srboisvert picture srboisvert · Apr 28, 2009 · Viewed 10.1k times · Source

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

User level information on the Playback control information

Answer

Daniel picture Daniel · May 4, 2009

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.