Skip to main content
GameDev.net gamedev.net
🔒 Locked

DirectSound question

Started by Torpedo Aug 4, 2006 at 11:46 AM 1 replies 900+ views
Original Post
Torpedo
Torpedo
This should be simple, but I'm not quite geting it. I have DirectSound working and I'm loading and playing wav files. No prob. My problem is: I'm playing a sound when my game character picks up an object, but if the character picks up two objects almost at the same time, the second sound is not played. I guess this is because the first sound is already playing, but I don't believe I have to create two diferent Sound buffers for the same object. Obviously this is not the way. How can I play two sounds at the same time from the same sound buffer?
circlesoft
circlesoft
It appears you have to duplicate the buffer:

From http://www.mvps.org/directx/faq/direct_sound.htm:

Quote:

Q. If I wish to play overlapping copies of a sound, do I have to load multiple copies?

While this will require multiple DirectSoundBuffer objects, you only need to perform the load once. You can make duplicate objects with the IDirectSound::DuplicateSoundBuffer function. These objects will reference the same memory buffer, so no additional memory will be required. The playback parameters for each object may be set independently.
Torpedo
Torpedo
I've been on vacation on the last 3 weeks, that's why I'm just replying now. I'll check the documentation and try the solution.

Ty

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.