MCI library still usable?

Get help with using AutoHotkey and its commands and hotkeys
x32
Posts: 104
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: 104
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.
x32
Posts: 104
Joined: 25 Nov 2016, 16:44

Re: MCI library still usable?

28 Aug 2019, 13:19

PuzzledGreatly wrote:
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.
Finally getting back to this. I'm not able to get your example to work either. What version of the MCI library are you using?

First difference I found is you used "mciSendString" and my library, v1.0 uses "MCI_SendString". Once I got that worked out the script would open but it would not play any sounds.

Chances are if I had the same version of the library it would work. Download link?
x32
Posts: 104
Joined: 25 Nov 2016, 16:44

Re: MCI library still usable?

28 Aug 2019, 15:25

Ok, after much searching I found MCI v1.1 and it works.

I first found it in an archive, of all the old libraries, on this forum (I think) but I can't find it again. However there is another copy here,
https://www.autohotkey.com/joe_df/autohotkey_scripts_archive/rbrtryn_3-04-2014.7z

A lot to search through the the MCI v1.1 library is in there.

Return to “Ask For Help”

Who is online

Users browsing this forum: blue83, dani0854, flyingDman, Gully, keokio, Mightykiller and 52 guests