Results 1 to 3 of 3

Thread: how to play midi file

  1. #1

    Thread Starter
    Hyperactive Member eranfox's Avatar
    Join Date
    May 2001
    Posts
    492

    how to play midi file

    Hello everybody,
    I want to play midi file when opening a file
    How do i do this?
    Thanks in advance,
    ERAN
    Eran Fox
    ASSEMBLER,C,C++,VB6,SQL...

  2. #2
    Hyperactive Member DKCK's Avatar
    Join Date
    Dec 2000
    Location
    United States
    Posts
    329
    One easy way to play a midi file is to use the Microsoft Multimedia Control.



    'CLOSE file that is playing
    mmControl.Command = "Close"

    'ENABLE
    mmControl.PlayEnabled = True

    'SET file name
    mmControl.FileName = "C:\Music\song.mid"

    'OPEN file
    mmControl.Command = "Open"

    'PLAY file
    mmControl.Command = "Play"

  3. #3
    Megatron
    Guest
    Or use the mciSendString API.
    VB Code:
    1. 'Open the midi
    2. mciSendString "open C:\MyFile.mid type sequencer alias midi", 0, 0, 0
    3.  
    4. 'Play the midi
    5. mciSendString "play midi", 0, 0, 0
    6.  
    7. 'Stop the midi
    8. mciSendString "stop midi", 0,0,0
    9.  
    10. 'Close the midi
    11. mciSendString "close midi", 0, 0, 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