31-12-2008, 05:04 PM
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!)
Now, check this line:
It doesn't work, unless I change it to this:
What teh feck?
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?