Results 1 to 6 of 6

Thread: Play buffer simultaneously

  1. #1

    Play buffer simultaneously

    Howdy! This may sound like a stupid question, but I'll ask it anyway. I have a classic DirectSound setup with a number of buffers. One of them is a "click" kind of sound that I play whenever the player mouse-overs over a button. Now this sound is played a lot because there are a lot of buttons that are close to each other. So it often happens that "play" is executed for a buffer that is still playing. Whenever that happens, the call to "play" is simply ignored and I don't hear anything. If I call "stop" first and then "play" it works fine but the sound effect are chopped of.
    So my question is: How do I play the same sound buffer again and again without having to stop it when it's still playing?
    Ask me about the xcess game development kit

  2. #2

    Play buffer simultaneously

    Aaarghh! I really need to brush up on my DirectSound knownledge again.
    Can't you have two (or more?) buffers and play the second click in the second buffer?
    Signature:
    <br />This is a block of text that can be added to posts you make. There is a 255 character limit

  3. #3

    Play buffer simultaneously

    Yeah, that's what I ended up doing. Thanks a lot anyway!
    Didn't think there was no way to play the same buffer several times simultaneously but i guess that's just how it is...
    Ask me about the xcess game development kit

  4. #4
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    Play buffer simultaneously

    Hmm... this idea may sound a bit exccessive, but could you not 'mix in' the click sound right into the buffer? Or have a pre-buffer that does this mixing? You may end up using some pretty low-level(in-line ASM) to get the job done fast, but it may allow you to keep to the one sound buffer.

    Only question is, can it be done fast enough?
    Jason McMillen
    Pascal Game Development
    Co-Founder





  5. #5

    Play buffer simultaneously

    I was just researching this myself! Since DirectSound can be hardware accelerated, it is fastest to create a buffer each time you want to play a sound because directsound will just send the sound into the soundcard for mixing if the soundcard supports it. Less CPU = Good.

  6. #6

    Play buffer simultaneously

    Less CPU work == More soundcard driver bugs :lol:
    There are only 10 types of people in this world; those who understand binary and those who don't.

Bookmarks

Posting Permissions

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