play middle C immediately請問那裡錯了!!! 當我按下button鍵,發出Do的音
Private oDX As New DirectX8
Private oDML As DirectMusicLoader8
Private oDMP As DirectMusicPerformance8
Private oDMS As DirectMusicSegment8
Private Sub Command1_Click()
Dim note As DMUS_NOTE_PMSG
note.midiValue = 60
note.mtDuration = 500
note.flags = DMUS_NOTEF_NOTEON
note.velocity = 127
Call oDMP.SendNotePMSG(0, DMUS_PMSGF_REFTIME, 1, note)
'Call oDMP.SendNotePMSG(0, DMUS_PMSGF_REFTIME, 1, note)
Print Err.Number
End Sub
Private Sub Form_Load()
InitAudio
End Sub
Private Sub InitAudio()
'We need to create our objects now
Set oDMP = oDX.DirectMusicPerformanceCreate
Set oDML = oDX.DirectMusicLoaderCreate
Dim dmusAudio As DMUS_AUDIOPARAMS
'Now call init audio
oDMP.InitAudio Me.hWnd, DMUS_AUDIOF_ALL, dmusAudio, Nothing, DMUS_APATH_SHARED_STEREOPLUSREVERB, 128
oDMP.SetMasterAutoDownload True
End Sub
Private oDX As New DirectX8
Private oDML As DirectMusicLoader8
Private oDMP As DirectMusicPerformance8
Private oDMS As DirectMusicSegment8
Private Sub Command1_Click()
Dim note As DMUS_NOTE_PMSG
note.midiValue = 60
note.mtDuration = 500
note.flags = DMUS_NOTEF_NOTEON
note.velocity = 127
Call oDMP.SendNotePMSG(0, DMUS_PMSGF_REFTIME, 1, note)
'Call oDMP.SendNotePMSG(0, DMUS_PMSGF_REFTIME, 1, note)
Print Err.Number
End Sub
Private Sub Form_Load()
InitAudio
End Sub
Private Sub InitAudio()
'We need to create our objects now
Set oDMP = oDX.DirectMusicPerformanceCreate
Set oDML = oDX.DirectMusicLoaderCreate
Dim dmusAudio As DMUS_AUDIOPARAMS
'Now call init audio
oDMP.InitAudio Me.hWnd, DMUS_AUDIOF_ALL, dmusAudio, Nothing, DMUS_APATH_SHARED_STEREOPLUSREVERB, 128
oDMP.SetMasterAutoDownload True
End Sub
全站熱搜
留言列表