tags:

views:

1643

answers:

2

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

User level information on the Playback control information

+1  A: 

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.

daub815
+1  A: 

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.

hypoxide