![]() |
help:Play Midi Problems - Printable Version +- Mirage Engine (https://mirage-engine.uk/forums) +-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61) +--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18) +---- Forum: Resources (https://mirage-engine.uk/forums/forumdisplay.php?fid=49) +---- Thread: help:Play Midi Problems (/showthread.php?tid=281) |
help:Play Midi Problems - Not2BeTrusted2 - 01-09-2006 help me wit this one lol Code: Public Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long - halla - 01-09-2006 yeah I can give you the code I use in my snake game... Code: Public Declare Function mciSendString Lib "winmm.dll" Alias _ Ok I put that all in a mod like modSound. "music.mid" you name as the name of your midi song. "mid1" is the name that you give it... you dont have to change this at all unless you want too. Now whenever you want it to play the music add in calls for opensong and play... Call OpenSong Call Play thats all you have to do to get it playing. Now if you want it to loop or something there is more code and I can help you with that if you like. Tell me if you can get it from here. EDIT: I looked at your code actually now and I see that you have the midi file named as 2 different things... thats probably your problem one you have it Background and the other Background something. Try that out. Re: help:Play Midi Problems - Robin - 01-09-2006 Not2BeTrusted2 Wrote:help me wit this one lol you missed out four '""'s Code: Public Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long ~Kite - Not2BeTrusted2 - 01-09-2006 ohh thank u but that code wit it kind of lags Code: Public Sub PlayMidi(Song As String) and for the other guy above that code wit the mid1 instead of background yes i get that code and i would like to get the loop |