Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
svenneve's avatar
svenneve
Explorer
6 years ago

Setting FMOD lowlevel driver for Oculus Spatial Audio for Rift GUID error

Previously we had to set the driver of the rift audio to the lowlevel driver of fmod in order to pass certification.
The last version of our game back then used 1.21 with Unity 2017.2.x

We are now upgrading to 2018.3.x with 1.35, we are however encountering an error that the OVRManager.audioOutId always returns an empty string as the driver device is 0 (IntPtr OVRP_1_1_0.ovrp_GetAudioOutId() always returns 0)
Is this old way of doing things still necessary? And if so, is something broken/changed/etc.

regards,

Sven

below is script (converted from c++ example on Oculus site)

using UnityEngine;



public class RiftAudioOutput : MonoBehaviour

{

#if UNITY_STANDALONE && OCULUS

  void Awake()

  {

    System.Guid guid = new System.Guid(OVRManager.audioOutId);

    var lowlevelSystem = FMODUnity.RuntimeManager.LowlevelSystem;

    int driverCount;

    lowlevelSystem.getNumDrivers(out driverCount);

    int driver = 0;

    while (driver < driverCount)

    {

      System.Guid fmodGuid;

      // the following variables are not 'used', but we need to create them as we can't use a nullptr as an out parameter in C#

      string name;

      int systemRate;

      FMOD.SPEAKERMODE speakerMode;

      int speakerModeChannels;



      lowlevelSystem.getDriverInfo(driver, out name, 256, out fmodGuid, out systemRate, out speakerMode, out speakerModeChannels);

      if(guid.CompareTo(fmodGuid) == 0)

      {

        break;

      }

      driver++;

    }

    if (driver < driverCount)

    {

      var result = lowlevelSystem.setDriver(driver);

    }

    else

    {

      Debug.LogError("Rift not connected");

    }

  }

#else

#endif

}

Replies have been turned off for this discussion