Properly Setup Spatial Audio

Dude @docEdub … that is awesome… Thanks so much for all your hard work and getting issues resolved quickly :slight_smile:

Hey @docEdub … FYI… Setting Pitch or Playback Rate does not work with BABYLON.StaticSound in V2.

A common practice in Unity for racing games, is to set pitch initially to zero use pitch at runtime to control the engine sound based on rpm.

Note: V1 pitch or playback rate works fine.

Ah yes, I see those properties need to update continuously, not just when play() is called. Thanks!

Yo @docEdub … Hey man, shouldn’t we be updating the listener position with the world space position and rotation of the attached node. It seems we are using the local space values. In V1, i think it used world space so you could parent that node at anytime and the spatial audio still worked for that node. Can you please check that out ?

1 Like

Yup. Rotation was tracking the world rotation, but position was not. Fixed by PR 16327.

1 Like

Fixed by PR 16326.

Love the bug reports - keep them coming!

1 Like