Is there a way to access WMP10+'s playback speed controls in a dotnet app?
Asked
Active
Viewed 1.1k times
3
-
So you want to speed up the content? Are you using the MediaElement or MediaPlayer objects? – kevindaub May 02 '09 at 13:31
-
I'm not using anything yet. I am just looking into how to do it whatever way it can be done. – srboisvert May 03 '09 at 09:42
2 Answers
10
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.

Daniel
- 10,864
- 22
- 84
- 115
-
This method is not working when I'm using online URL like: mpMediaPlayer.FileName = "http://example.com/example.mp4" – Lavneet Dec 22 '13 at 11:34
1
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.

kevindaub
- 3,293
- 6
- 35
- 46