[ODE] Contact sound generation

Megan Fox shalinor at gmail.com
Wed Nov 3 16:22:19 MST 2004


To get around the multiple sound problem (6 different contacts per
object per scene, or whatever), as well as the stacking sounds problem
(one at full volume, then the next frame, one at slightly less volume,
etc - spirals out quickly), you might consider sound states rather
than just generating sounds.

That is - for a box.  "Am I sliding?"  "Am I hitting?"  "Am I hitting
hard?" etc.  I suppose you could spiral that out to "am I hitting
metal" or "am I sliding against metal", and so on.  Each of these
states is linked to a specific sound, and that sound remains in
play/looping as the state is true, and is stopped when the state goes
to false.  You might want those to be numeric values rather than
true/false, which would let you stick the volume in as well (which
would reduce over time as the slide rate slowed, and would make it
easy to play the loudest of the potential sounds per object per
frame).

This does mean that a single box could only play a single "sliding
against metal" noise, no matter how many metallic surfaces it's
sliding against, but that does tend to make sense - short of having
very large objects sliding against different surfaces at different
points, a single sliding noise emanating from the center of the object
is a fine approximation.


-Megan Fox

> Note that you WILL need filtering, as there's typically a number of
> contacts between two bodies. And you only want to play sounds for
> contacts between body pairs that are "new" -- else, objects at rest
> would keep generating the same sounds (although very silently).
> 
> Cheers,
> 
>                / h+


More information about the ODE mailing list