Results 1 to 5 of 5

Thread: 2 music files at once

  1. #1

    Thread Starter
    Hyperactive Member PITBULLCJR's Avatar
    Join Date
    Nov 1999
    Location
    New York
    Posts
    408

    Post

    Is there a way to have lets say a background .wav file playing then when something happens another .wav file plays but the background music keeps playing so you have the background music playing and another at the same time and you can hear them both? thanks a lot!!

    ------------------
    Sincerely,
    Chris
    :-) ;-)
    just have fun out there and live life to the fullest while it is still here
    Email pitbullcr7@aol.com


  2. #2
    Hyperactive Member
    Join Date
    Sep 1999
    Posts
    305

    Post

    La dee da, put this where it goes, you know the drill.

    Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" _(ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
    Const SND_SYNC = &H0
    Const SND_ASYNC = &H1
    Const SND_NODEFAULT = &H2
    Const SND_LOOP = &H8
    Const SND_NOSTOP = &H10

    and this in it's correct place:

    wFlags = SND_SYNC Or SND_NODEFAULT
    x1 = sndPlaySound("Your file, wFlags)
    x2 = sndPlaySound("Your file, wFlags)

    and that should be it. you don't need all the constants and they are pretty self explanatory as to what they do. BTW, Synchronous means at the same time (syn=same chron=time) asynchronous means it suspends the program until it's done playing the sound. Hope it works.

    bob

  3. #3
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800

    Post

    I get an error on this:

    Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" _(ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
    Const SND_SYNC = &H0
    Const SND_ASYNC = &H1
    Const SND_NODEFAULT = &H2
    Const SND_LOOP = &H8
    Const SND_NOSTOP = &H10

    then I get, sndplaysound "argument not optional"




    ------------------
    Steve Mack
    ----------
    Teenage Programmer
    Email: SteveCRM@aol.com

  4. #4
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485
    Anyone know how to make this work? I'm new to sound and need a hand.

  5. #5
    Fanatic Member tim_l_012's Avatar
    Join Date
    Mar 2001
    Location
    Next to a Coffee Cup.
    Posts
    641
    you have an underscore "_" in a single line declare...

    try taking it out

    HIH,
    /: Tim :\____________________
    \: VB, HTML, ASP, VBScript, QBASIC, JavaScript :/

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