MCI library still usable?

Get help with using AutoHotkey and its commands and hotkeys
x32
Posts: 101
Joined: 25 Nov 2016, 16:44

MCI library still usable?

28 Jan 2019, 08:43

Dug out one of my old Win XP scripts because I have a new use for it. It is a media player that would retrieve the total length of a track and the time left. Now, on Win 10, it doesn't work at all and I can find no apparent reason.

It was entirely based on the MCI.ahk library. Does anyone know if this old library can still be used in Win 10 and the latest version of AHK or is it obsolete?

Does anyone know of another method to get the total song length?

MCI.ahk
https://github.com/camerb/AHKs/blob/master/thirdParty/MCI.ahk

Edit, here is a simple play script using the MCI library. The "Open" command always returns an error.

Code: Select all

#Include, MCI.ahk

song = %A_ScriptDir%\abbeybellsfx.wav 
Gui, Add, Button, x5 y5 w100 h25 vb1 gb1, Play
Gui, Show, w110 h50 , Simple MCI Player 
Return

b1:
hMedia:=MCI_Open(song)
MsgBox, %hMedia%
MCI_Play(hMedia)
Return
User avatar
PuzzledGreatly
Posts: 726
Joined: 29 Sep 2013, 22:18

Re: MCI library still usable?

10 Apr 2019, 18:26

I just found this thread. I can use mci functions to play audio on a laptop that used to run Windows 8 but was upgraded to windows 10. I always stop a sound before I play it, eg:

Code: Select all

NOW := "Full path to Sound File"

space::

CloseSound("NowPlaying")
Playsound(NOW, "NowPlaying")

return

; ====================================================================

PlaySound(SoundFile, SoundAlias, Flags="") { ; Flags: repeat, etc...
  mciSendString("open " """" SoundFile """" " type mpegvideo Alias " SoundAlias)
  mciSendString("play " SoundAlias " " Flags)
}

CloseSound(SoundAlias) {
  mciSendString("close " SoundAlias)
}

;..Rest of the MCI library
I can post the mci functions I have if that would be useful.
x32
Posts: 101
Joined: 25 Nov 2016, 16:44

Re: MCI library still usable?

12 Apr 2019, 15:02

Thanks for the reply. I haven't had, and won't have time to look at your example, for a few days but I will. I'll compare your functions with what's in my library and see if there is any difference.

Return to “Ask For Help”

Who is online

Users browsing this forum: Google [Bot], strzmatt1988, TheArkive and 207 guests