Open trethaller opened 5 years ago
How 2D spatialization would work however? Just panning tweaks?
Yes basically, right now you have to put a listener at a fixed distance and move objects on a plane to simulate that
I wanted to look into this, but am currently having problems with getting the spatialization to work.
It seems to do nothing on both mac and windows. The volume of clips seem to fade out and in, but that is purely based on the fadeDistance
parameter. The parameters that are set in openAL seem to do nothing. The spatialization sliders in the sound sample doesn't change the sound.
Edit: While spatialization works for stereo sounds on html, it does not on hl. After converting my sounds to mono it works.
Attaching sounds to moving objects pretty standard. Current API doesn't enable this out of the box, the
position
,velocity
anddirection
properties ofhxd.snd.effect.Spatialization
have to be updated manually by the game code.Possible improvements:
position
anddirection
by ah3d.Matrix
, which would allow hooking-up to ah3d.scene.Object.absPos
and get position updates for free. This doesn't solve the problem of recomputing velocityfollowObject
property, and add anupdate()
method tohxd.snd.Effect
, so we can update the fields inSpatialization
. There we could also calculate the velocityOther considerations:
Looking for feedback and/or volunteers