HeapsIO / heaps

Heaps : Haxe Game Framework
http://heaps.io
MIT License
3.19k stars 338 forks source link

Audio spatialization improvements #651

Open trethaller opened 5 years ago

trethaller commented 5 years ago

Attaching sounds to moving objects pretty standard. Current API doesn't enable this out of the box, the position, velocity and direction properties of hxd.snd.effect.Spatialization have to be updated manually by the game code.

Possible improvements:

Other considerations:

Looking for feedback and/or volunteers

Yanrishatum commented 5 years ago

How 2D spatialization would work however? Just panning tweaks?

trethaller commented 5 years ago

Yes basically, right now you have to put a listener at a fixed distance and move objects on a plane to simulate that

jefvel commented 4 years ago

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.