Jump to content

Recommended Posts

Posted

It will be very nice if every time a script is executed, a MIDI file be played at background. I want use windows winmm.dll for this aim. Is this possible with AutoIT3?

Thanks beforehand

Posted

There is DLLCall function, try using it.

Thanks for answer. I used it, but MIDI files are not played to the end! No problem with other music files, just with MIDI files. Another problems is that I didn't know how to repeat the playing. My sample code was:

$MIDFile = "a.mid"
DllCall( "winmm.dll", "int", "mciExecute", "str", "play " & $MIDFile)
Sleep(5700)

any help?

Posted (edited)

Thanks for answer. I used it, but MIDI files are not played to the end! No problem with other music files, just with MIDI files. Another problems is that I didn't know how to repeat the playing. My sample code was:

$MIDFile = "a.mid"
DllCall( "winmm.dll", "int", "mciExecute", "str", "play " & $MIDFile)
Sleep(5700)

any help?

:/ Wasn't playing with the dll... but... I guess the script ends as the time music ends? :P

HotKeySet("{ESC}", "_Exit")
$MIDFile = "a.mid"
DllCall( "winmm.dll", "int", "mciExecute", "str", "play " & $MIDFile)
While 1
Sleep(1)
WEnd

Function _Exit()
Exit
EndFunc

<Not tested, press ESC to exit>

Edited by i542

I can do signature me.

Posted

Search on forum about MidiUDF.au3

I was searched the forum before my post for three days :P The MidiUDF.au3 is for working with MIDI Devices & MIDI notes, not for playing MIDI files. BTW, thanks for your answer.

Posted

(...) I guess the script ends as the time music ends? :P (...)

No, the script will be executed even after the music time is ended. Execution will be ends just after pressing ESC hotkey.

And there is another important problem too. I will the music be played at beckground repeatedly, but with the code, the MIDI file is played once and script is not executed during music playing.

Regards

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...