| Mirage Source http://miragesource.net/forums/ |
|
| Issue With Music http://miragesource.net/forums/viewtopic.php?f=201&t=4906 |
Page 1 of 1 |
| Author: | Xlithan [ Wed Dec 31, 2008 5:04 pm ] |
| Post subject: | Issue With Music |
This is a really annoying error which I can't seem to figure out. Here's my sound module (OMG I GIVETH OUT TEH SOURCE!) Code: Option Explicit Private Const SND_ASYNC As Long = &H1 Private Const SND_NODEFAULT As Long = &H2 Private CurrentSong As String Private 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 Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, _ ByVal uFlags As Long) As Long Public Sub MakeMidiLoop() Dim SBuffer As String * 256 mciSendString "STATUS background MODE", SBuffer, 256, 0 If Left$(SBuffer, 7) = "stopped" Then mciSendString "PLAY background FROM 0", vbNullString, 0, 0 End If End Sub Public Sub PlayMidi(Song As String) If ReadINI("CONFIG", "Music", App.Path & "\config.dcf") = 1 Then If CurrentSong <> Song Then CurrentSong = Song mciSendString "close all", 0, 0, 0 mciSendString "open """ & App.Path & "\music\" & Song & """ type sequencer alias background", 0, 0, 0 mciSendString "play background notify", 0, 0, frmGame.hwnd End If Else StopMidi End If End Sub Now, check this line: Code: mciSendString "open """ & App.Path & "\music\" & Song & """ type sequencer alias background", 0, 0, 0 It doesn't work, unless I change it to this: Code: mciSendString "open """ & App.Path & "\" & Song & """ type sequencer alias background", 0, 0, 0 What teh feck? |
|
| Author: | DarkX [ Thu Jan 01, 2009 5:51 am ] |
| Post subject: | Re: Issue With Music |
Where is your music located? here's mine for example Code: mciSendString "open """ & App.Path & "\Data\Music\" & Song & """ type sequencer alias background", 0, 0, 0 and it works perfectly (also though, I am using MS3.0.3) the sound part that you posted is not that much different or at all any different.
|
|
| Author: | Tony [ Thu Jan 01, 2009 7:42 am ] |
| Post subject: | Re: Issue With Music |
What's your problem if it works then? |
|
| Author: | Xlithan [ Thu Jan 01, 2009 5:21 pm ] |
| Post subject: | Re: Issue With Music |
Because I don't want all my music in the main directory, I want the music in a Music folder, but when I type in a folder, it doesn't work. |
|
| Author: | Rian [ Thu Jan 01, 2009 6:14 pm ] |
| Post subject: | Re: Issue With Music |
Dunno, haven't programmed in ages, but perhaps: Code: mciSendString "open """ & App.Path & "\music\" & Song & """ type sequencer alias background", 0, 0, 0 Code: mciSendString "open """ & App.Path & "\music" & Song & """ type sequencer alias background", 0, 0, 0
|
|
| Author: | Xlithan [ Thu Jan 01, 2009 9:01 pm ] |
| Post subject: | Re: Issue With Music |
No, because the Song variable only holds NameOfSong.mid |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|