3D Sound

You need to create a source and a listener objects in your application and to assign them to a Player.
3D positioning will be applied to the sound generated by the Player according the source and listener positions.

craftv2_tips_program_doing_3dsound00.png

Update every frame

If it changes, it is necessary to update the position of these objects on each frame. Since in most cases both the listener and the sound source are moving, simply update the positions every frame.

craftv2_tips_program_doing_3dsound01.png

Notes on the Doppler effect

It is possible to configure the Doppler effect in the tool.
However, if you do not update the positions properly at run-time, it will not sound right.
For example, if the camera suddenly moves, it can cause unnatural sounds.
In ADX, the Doppler effect works by setting the velocities separately from the positions.
The Doppler effect will not occur unless the velocities of the objects are set.

craftv2_tips_program_doing_3dsound02.png

Focus

By separating the distance attenuation and angle processing from the source and listener processing, you can have more control on the 3D sound.

craftv2_tips_program_doing_3dsound03.png