WMP playback speed

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
PuzzledGreatly
Posts: 1303
Joined: 29 Sep 2013, 22:18

WMP playback speed

17 Apr 2023, 01:32

I know how to embed windows media player into an activex control and start and pause a video and move around the timeline. Does anyone know how to change the playback speed. - have a video player more slowly or more quickly. Thanks. This is the basic code I'm using:

Code: Select all

	Gui, Video:New, -Caption +owndialogs +HwndVideo -dpiscale +E0x02000000 +E0x00080000, %Video%
	;Gui, % "+" . WS_CLIPSIBLINGS := 0x04000000
	Gui, color, black
	Gui, margin, 0,0

	Gui, Add, ActiveX, x0 y0  w%A_screenwidth% h%A_screenheight% vWMP, WMPLayer.OCX ;need to do screen size checks
	
	WMP.uiMode := "none"                         ; no WMP controls
	WMP.stretchToFit := 1                        ; video is streched to the given activex range
	WMP.enableContextMenu := 0                   ; no reaction to right click in the video field
	
	Gui, Show, x%A_screenwidth% hide, Player GUI
	Media := WMP.newMedia("P:\WiseFiles\Games\Chase\Bits\#chase.mp4")                  ; create a new Media object
	
	WMP.currentMedia := Media                    ; set the players 'currentMedia' object
	WMP.controls.play                            ; play
	sleep 800
	Gui, show, x1920 y0 w%A_screenwidth% h%A_screenheight%
ananthuthilakan
Posts: 188
Joined: 08 Jul 2019, 05:37
Contact:

Re: WMP playback speed

17 Apr 2023, 09:22

as mikeyww has already given a way to do that
i will share an alternate application, that will do it and many more created in ahk ( Vlc )
viewtopic.php?f=6&t=115860
hotkeys.png
hotkeys.png (120.66 KiB) Viewed 351 times
User avatar
PuzzledGreatly
Posts: 1303
Joined: 29 Sep 2013, 22:18

Re: WMP playback speed

17 Apr 2023, 18:06

Thanks for the replies. I want to avoid using vlc, if possible, as wmp is "built" into windows directly. Mikey, do you have an ahk example? I've tried using various permutations of rate eg

WMP.settings.rate = 0.5
WMP.controls.rate = 0.5
WMP.controls.settings.rate = 0.5
WMP.rate = 0.5

Amongst others, but always get an 0x80020006 error message - Unknown name.
User avatar
mikeyww
Posts: 27199
Joined: 09 Sep 2014, 18:38

Re: WMP playback speed

17 Apr 2023, 18:26

Code: Select all

#Requires AutoHotkey v1.1.33
sound := A_WinDir "\Media\Ring08.wav"
If !FileExist(sound) {
 MsgBox, 48, Error, % "File not found.`n`n" sound
 Return
}
Gui Add, ActiveX, vAV, WMPLayer.OCX
AV.settings.rate := 1.0
AV.settings.rate := 0.5
AV.Url           := sound
User avatar
PuzzledGreatly
Posts: 1303
Joined: 29 Sep 2013, 22:18

Re: WMP playback speed

18 Apr 2023, 07:00

Thanks Mikey, your post led me to re-examine my code. I had a typo. I had typed setting instead of settings. I just didn't see it before I posted. Your code works and now mine does as well, thanks again.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot] and 170 guests