Oculus Native Spatializer plugin for Unity Requirements and Setup

Requirements

Download and Setup

To download the ONSP and import it into a Unity project:

  1. Download the Oculus Spatializer Unity package from the Audio Packages page.
  2. Extract the zip.
  3. Open your project in the Unity Editor, or create a new project.
  4. Select Assets > Import Package > Custom Package....
  5. Select OculusNativeSpatializer.unitypackage and import.
  6. When the Importing Package dialog opens, leave all assets selected and click Import.

To turn on the Native Spatializer:

  1. Go to Edit > Project Settings > Audio in Unity Editor
  2. Select OculusSpatializer in the Spatializer Plugin drop-down setting in the AudioManager Inspector panel as shown below.

We recommend Rift developers set DSP Buffer Size to Best latency to set up the minimum buffer size for the platform that is supported, reducing overall audio latency.

Gear VR developers should set DSP Buffer Size to Good or Default to avoid audio distortion.

Updating to Oculus Native Spatializer for Unity from previous OSP for Unity Versions

  1. Note the settings used in OSPManager in your project.
  2. Replace OSPAudioSource.cs (from previous OSP) on AudioSources with ONSPAudioSource.cs in {project}/Assets/OSP.
  3. Set the appropriate values previously used in OSPManager in the plugin effect found on the mixer channel. Note that the native plugin adds functionality, so you will need to adjust to this new set of parameters.
  4. Remove OSPManager from the project by deleting OSPManager*.* from {project}/Assets/OSPexcept your newly-added ONSPAudioSource.cs.
  5. Verify that OculusSpatializer is set in the Audio Manager and that Spatialization is enabled for that voice.

Use the functions on AudioSource to start, stop and modify sounds as required.