Results 1 to 3 of 3

Thread: Playing MIDI files

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2000
    Posts
    55

    Question

    I have a command button called CmdPlay.

    What code do I type in so that it plays a certain MIDI file when I click on it? Please Help me
    Thanks
    Beres

  2. #2
    Guest
    Use the mciSendString API.
    Code:
    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 Sub cmdStart_Click()
        'Start playing
        mciSendString "open C:\mptheme.mid type sequencer alias midi", 0, 0, 0&
        mciSendString "play midi", 0, 0, 0&
    End Sub
    
    Private Sub cmdStop_Click()
        'Stop Playing
        mciSendString "close midi", 0, 0, 0&
    End Sub

  3. #3
    Guest
    the other way is to use the Microsoft Multimedia control 6.0 what shipping with VB6.0

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