How to play multiple sound effects?-VBForums
Results 1 to 3 of 3

Thread: How to play multiple sound effects?

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2007
    Location
    South-East England
    Posts
    1

    Post How to play multiple sound effects?

    I am making a small game in VB6 and I need to know how to play multiple sound effects.

    Right now I am using...
    Code:
    Private Declare Function sndPlaySound Lib "winmn.dll" Alias "sndPlaySoundA" _
    (ByVal ipszSoundName as String, ByVal uFlags As Long) As Long
    and triggering a sound with...
    Code:
    sndPlaySound "soundfile.wav",1
    This code only allows me to play one sound at a time.
    I need to know how to play multiple sounds at once, at least five.

    Thanks,

  2. #2
    Super Moderator Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,334

    Re: How to play multiple sound effects?

    VB is a single threaded development platform. You need it to multi-task beyond its capabilities.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    I dont answer coding questions via PM or EMail. Please post a thread in the appropriate forum section.

    Creating A Wizard In VB.NET
    Paging A Recordset
    What is wrong with using On Error Resume Next
    Good Article: Language Enhancements In Visual Basic 2010
    Upgrading VB6 Code To VB.NET
    Microsoft MVP 2005/2006/2007/2008/2009/2010/2011/2012/Defrocked

  3. #3
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,720

    Re: How to play multiple sound effects?

    You probably need to do this in DirectSound

    I did something simmilar in this thread:
    http://www.vbforums.com/showthread.php?t=376046

    Look at the attachment in post #22

    [Edit]
    Also, take a look at my sound tutorial (though not finished) to learn more.
    Last edited by CVMichael; May 29th, 2007 at 03:13 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.