Archived

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

Shazer

Ball bounces twice, sound plays once??

Recommended Posts

Shazer    122
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
risingdragon3    382
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