Positional audio in VR (HTC Vive)

Positional audio in VR (HTC Vive)

joakim.gronlund
Explorer Explorer
349 Views
1 Reply
Message 1 of 2

Positional audio in VR (HTC Vive)

joakim.gronlund
Explorer
Explorer

I searched but didn't find a solution for positional audio with the HTC Vive. We use the template, imported my own sounds in Wwise (fireplace) and ticked "3D" under "Positioning" and "3D Attenuation" to "default" and updated the SoundBank. I get a nice sphere showing where the sound attenuates in the editor, and it works when I deploy and run it non VR using WASD + Mouse. However when running the same project in VR the sounds aren't tracked.

 

Where do you change the listener so it works with the Vive?

Reply
Reply
0 Likes
350 Views
1 Reply
Reply (1)
Message 2 of 2

__ben__
Alumni
Alumni

 

It appears some of the vr templates are missing the update to the wwise listener position.

 

In script\lua\project.lua, update the function `function Project.update(dt)`

 

...to also update the Wwise listener, like so (not tested):

 

```

-- Update the Wwise Listener to include the Oculus device pose

if stingray.Wwise and stingray.SteamVR then

               head = stingray.SteamVR.hmd_local_pose()

               local managed_world = Appkit.managed_world

               stingray.WwiseWorld.set_listener(

                              stingray.Wwise.wwise_world(managed_world.world),

                              stingray.Wwise.LISTENER_0,

                              head

                              )

end

```

Reply
Reply
0 Likes