Thread: Multiple sounds in DX

  1. #1
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607

    Multiple sounds in DX

    It looks to me as though DirectX can natively only play one sound at a time. In order to get multiple sounds overlapping, do I once again have to program my own mixer like I did in DOS and then send the mixed data to DirectSound to play?

  2. #2
    I don't know much about DX, but couldn't you use threads?

  3. #3
    Registered User
    Join Date
    Oct 2001
    Posts
    62
    Microsoft DirectX 8.1 SDK > DirectX SDK Help > DirectX Documentation for C++ > Search > "mixing sounds"

    You should find a document that starts with the following paragraph:

    "It is easy to mix multiple streams with DirectSound. You simply create secondary sound buffers, obtaining an IDirectSoundBuffer8 interface for each sound. You then play the buffers simultaneously. DirectSound takes care of the mixing in the primary buffer and plays the result. (...)"

    Sounds like this is exactly what you are looking for. You may also take a look at article "Creating secondary sound buffers."

  4. #4
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Thx all. I figured it out as soon as I posted. I'm not exactly using the SDK help file since its so convoluted.

    I've got the sound working and now I'm working on some classes for DirectInput.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 16
    Last Post: 06-08-2009, 03:03 PM
  2. Phantom redefinition
    By CodeMonkey in forum C++ Programming
    Replies: 6
    Last Post: 06-12-2005, 05:42 PM
  3. Linker errors - Multiple Source files
    By nkhambal in forum C Programming
    Replies: 3
    Last Post: 04-24-2005, 02:41 AM
  4. DirectSound - multiple sounds
    By Magos in forum Game Programming
    Replies: 9
    Last Post: 03-03-2004, 04:33 PM
  5. My graphics library
    By stupid_mutt in forum C Programming
    Replies: 3
    Last Post: 11-26-2001, 06:05 PM