Tuesday, December 13, 2016

Add a Spatial Sound

Making use of the Google Cardboard SDK, you can add spatial sounds to your scene that react to head direction changes.

You can add a spatial sound in two ways:

  • Drag a GvrAudioSource prefab into your scene
  • Add the GvrAudioSource script to your object
Ensure that your project settings have the Audio value of Spatializer Plugin set to the GVR Audio Spatializer.

Edit > Project Settings > Audio


You also may have to enable the GvrAudioListener script that resides on the GvrMain > Head > MainCamera game object.  This is provided as a part of the prefab.

At this point, when you play your game, you should hear the sound (assuming the source is in range), and as you turn your head, you should hear the sound move accordingly.

No comments:

Post a Comment