Archived

This topic is now archived and is closed to further replies.

Ball bounces twice, sound plays once??

This topic is 6168 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am using direct sound. In my Breakout game, whenever the ball hits a wall or the paddle, it boings... whenever it hits a block, it blooeeps... But, whenever there are two sounds of the same type really close together, it only plays one. How can I make it sound twice?? The Shaz "I don''t want to be a pie... I don''t like gravy." - Babbs, Chicken Run SuperNova Games

Share this post


Link to post
Share on other sites
Thats because by default DirectSound will not replay a sound if a sound is already playing. What I did was to have a ReplicateSound function copy the buffer via duplicateBuffer or something like that. Look up the IDirectSound * interface. Remember to release the copied buffer once the sound has finished playing. Also, the function duplicateBuffer only copies the interface. The buffer is not duplicated.

------------------------------
BCB DX Library - RAD C++ Game development for BCB

Share this post


Link to post
Share on other sites