=sinister= Posted December 31, 2009 Share Posted December 31, 2009 (edited) I'm not sure where to begin debugging this. For some reason, the midi udf: http://www.autoitscript.com/forum/index.php?showtopic=37072&hl=midi&st=0 does not produce any sound. I've tried various amounts of scripts with it (including some posted on these boards). If anyone could help me out, I'd really appreciate it. Running Windows 7 x64 bit (And other programs that use midi that aren't coded in autoit work properly) Edited December 31, 2009 by =sinister= Link to comment Share on other sites More sharing options...
smashly Posted December 31, 2009 Share Posted December 31, 2009 (edited) Hi, Just force MCI to use the Sequencer to play the mid file, crude example.expandcollapse popup#include <Misc.au3> $sAlias = _RandomStr() _mciSendString("open " & FileGetShortName(@WindowsDir & "\Media\flourish.mid") & " alias " & $sAlias & " type Sequencer") _mciSendString("play " & $sAlias) While (Not _IsPressed("1B")) ;Esc to exit Sleep(100) WEnd ; #FUNCTION# ============================================================================================== ; Name...........: _RandomStr ; Description....: Creates a random string ; Syntax.........: _RandomStr([$iLen = 10]) ; Parameters ....: $iLen - Length of string to return ; Return values .: Success - Returns a string of random letters (a~z) ; Author ........: RazerM ; ========================================================================================================= Func _RandomStr($iLen = 10) Local $sTmp = '' For $i = 1 To $iLen $sTmp &= Chr(Random(97, 122, 1)) Next Return $sTmp EndFunc ;==>_RandomStr ; #FUNCTION# ============================================================================================== ; Name...........: _mciSendString ; Description....: ; Syntax.........: _mciSendString($string[, $iLen = 0]) ; Parameters ....: $string ; $iLen ; Return values .: ; Author ........: RazerM ; ========================================================================================================= Func _mciSendString($string, $iLen = 0) Local $iRet $iRet = DllCall("winmm.dll", "int", "mciSendStringA", "str", $string, "str", "", "long", $iLen, "long", 0) If Not @error Then Return $iRet[2] EndFunc ;==>_mciSendString I'm using Win7 x64 and it works for me.. Cheers Edited December 31, 2009 by smashly Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now