Results 1 to 2 of 2

Thread: How do I play a MIDI file

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2000
    Posts
    55
    I want to know what code to type in FrmBajent_Load inorder to play an Midi file. Please be specific...I have little knowledge...thanks
    Beres

  2. #2
    Guest
    Here is how to play a MIDI file:

    Code:
       Private Declare Function mciSendString Lib "winmm.dll" Alias _
       "mciSendStringA" (ByVal lpstrCommand As String, ByVal  _
       lpstrReturnString As Any, ByVal uReturnLength As Long, ByVal _
       hwndCallback As Long) As Long
    
       Private Sub Command1_Click()
       Dim ret As Integer
    
       ' The following will open the sequencer with the C:\WIN31\CANYON.MID
       ' file. Canyon is the device_id.
    
       ret = mciSendString("open c:\windows\CANYON.MID _
       type sequencer alias canyon", 0&, 0, 0)
    
       ' The wait tells the MCI command to complete before returning control
       ' to the application.
    
       ret = mciSendString("play canyon wait", 0&, 0, 0)
    
       ' Close CANYON.MID file and sequencer device
    
       ret = mciSendString("close canyon", 0&, 0, 0)
    
       End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width