Results 1 to 3 of 3

Thread: When I play a sound using that mcisendstring thing how do I let the user use the prog

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 1999
    Posts
    65

    Post

    ram normally, while still playing the sound. Like BGSOUND on a website? I got code off of this site, but it uses that wait crap, which doesn't return control to windows until the sound has played, and well...it sucks.

    ------------------
    "I'm carrying a Geometry book, but I'm not in Geometry...it's crazy...crazy man!"

  2. #2
    Lively Member
    Join Date
    Jun 1999
    Location
    Ireland
    Posts
    96

    Post

    If you're playing a .Wav File then use the SndPlaySound API with the Async setting.

    Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

    Const SND_ASYNC = &H1

    sndPlaySound "MySound.Wav", SND_ASYNC

    ******************************************

    If playing a Midi File then use mciSendString

    void = mciSendString("close all", 0&, 0, 0)
    void = mciSendString("open MyMid.mid type sequencer alias MyMidi", 0&, 0, 0)
    void = mciSendString("play MyMidi", 0&, 0, 0)


    Hope this helps,

    Steve.

    PS. Try not to be so negative when asking a question!!!! That wait CRAP is quite useful in other applications of this function.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Oct 1999
    Posts
    65

    Post

    I'm sure the wait 'crap' helps alot. But not so much in mine. But, the thing is I tried the code you gave me right... but it plays approximately a tenth of a second of the sound.

    Any suggestions? Maybe why I can't get this to play the full length?

    ------------------
    "I'm carrying a Geometry book, but I'm not in Geometry...it's crazy...crazy man!"

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