MIDI
初始化
Function winmmInitMidi As Integer
Function = mciSendString( "open sequencer", Null, 0, 0 ) = 0
End Function
播放文件
Function winmmPlayMidi( ByVal filename As String ) As Integer
If( mciSendString( "open " + filename + " alias mymidifile", Null, 0, 0 ) <> 0 ) Then
Return 0
End If
Function = mciSendString( "play mymidifile", Null, 0, 0 ) = 0
End Function
停止播放
Function winmmStopMidi( ) As Integer
mciSendString( "stop mymidifile", Null, 0, 0 )
Function = mciSendString( "close mymidifile", Null, 0, 0 ) = 0
End Function
释放
Function winmmEndMidi As Integer
Function = mciSendString( "close sequencer", Null, 0, 0 ) = 0
End Function
WAV
Function winmmPlayWave( ByVal filename As String ) As Integer
Function = sndPlaySound( filename, SND_ASYNC )
End Function