Sounds in the 3D world

Hi Pandas,

I searched the forum and the manual but I haven’t found an answer
if this is already possible or not.

So imagine a scene/terrain/model where you have a little creek that
flows around and somewhere in that scene is a waterfall. The fall should
roar loudly when the player stands right beside it.
The volume of the sound should change according to the distance between
waterfall and player (camera or avatar). Also the direction of the sound
(left or right stereo channel) should change depending on the position of
the player (or camera).

I know that I can set up a task to check the player-waterfall-relations
and modify the sound according to the results.
But wouldn’t it be a really great feature of the Panda3D engine if I
could just set up a special node (let’s call it a sound node), give it
a position in my 3D world (or reparent it to a model), set a reference
node (camera or avatar) and the engine does all the modifications to the
sound depending on the position and direction of the reference node?

I imagine a sequence like this one:

  1. load sound
  2. create a sound node
  3. set reference node(path) for distance and position check
  4. set max volume of the sound
  5. set radius where the sound should be heard
  6. parent waterfall model to sound node

I think I could create such behavior with tasks and so on but I’m pretty
sure the performance would be a lot better if it’s implemented in the
engine itself (written in C).

What do you think about that?

that’s what fmod is doing =) full 3d-sound support including a number of fancy effects like reverb and whatever. … Attributes
as you can see you can set the position and the speed of your soundsource.
i havent tried it yet but i think panda should take care of the rest (if you simply move the camera. as you can see there are also parameters for maxdistanve and volume.
just try playing around with it =)

Well, thanks Thomas.
Now I see that it was a needless question after all. But at least someone pushed me in the right direction. I think I will have to read the manual more carefully. :unamused: