Hi,
I am currently trying to come up with a good solution for the situation where I have several collisions and want to play sounds in response to them. With most aspects of the game, I can control with a degree of certainty when I play what sound, but for something as dynamic as the collision detection system, I'm a little stuck. For example, say I have a large stack of boxes that I knock over. I would like them to play small bumping-into-each-other sounds as they are falling and colliding with one another and with the floor. The issue is that, especially once they have reached the floor but before the physics system (impulse based) has put them to sleep, they keep firing collision events and playing the sound as they make minuscule adjustments to their positions.
One solution I've come up with is to observe the velocity of the impacts and not play a sound below a certain threshold. This could be extrapolated to include playing softer sounds at lower impact velocities until a final cutoff (so resting but not sleeping objects would still be silent), but there's a lot of trial-and-error involved in getting the thresholds exactly right.
Are there any more direct or obvious approaches to handling this type of situation that I'm overlooking, or is this the right track?