Results 1 to 3 of 3

Thread: Play Midi file without wait....

  1. #1

    Thread Starter
    Frenzied Member wengang's Avatar
    Join Date
    Mar 2000
    Location
    Beijing, China
    Posts
    1,604
    If anyone knows how to play a MIDI file during a game without stopping the game, please do let me know. Thanks.


  2. #2
    Hyperactive Member
    Join Date
    Jan 2000
    Posts
    355
    yeah, use DirectMusic, assuming your game is DirectX.
    Otherwise, can't you use MciExecute or something?
    buzzwords are the language of fools

  3. #3

    Thread Starter
    Frenzied Member wengang's Avatar
    Join Date
    Mar 2000
    Location
    Beijing, China
    Posts
    1,604

    Using MCI Sendstring but no result

    Well, it isn't DirectX (which I still don't know how to use). I am using this one that I found in a FAQ on another website:
    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

    Dim ret As Long
    (and in the sub)
    ret = mciSendString("open c:\midi\myfile.mid type sequencer alias myfile", 0&, 0, 0)
    ret = mciSendString("play myfile wait", 0&, 0, 0)
    ret = mciSendString("close myfile", 0&, 0, 0)

    The problem is with the "WAIT" command the Midi starts when the game starts and then control is not returned to the game until the MIDI finishes. When the "WAIT" is taken out, it simply doesn't play the MIDI. Any thoughts?

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