Hi.
We are sending our game to the Oculus team and they are reporting that the game “must target the audio device selected in the “Audio Output in VR” setting in the Oculus app.”
We have pasted the code snippet that can be found on their website, but nothing seems to work. I also changed the deprecated “getLowLevelSystem” for the “getCoreSystem”, but nothing seems to work.
We recently made handling Oculus driver selection a lot easier and provide an example specifically for implement that behavior. Check out our Unity docs for details.
In order to prevent problems, we would like to avoid a major version upgrade. We are currently using the version 2.0.10 and the game is already published in some stores.
The last build I sended to them was this one. But they still report that there’s no audio through the target device.
public void PreInitialize(FMOD.Studio.System studioSystem)
{
string riftId = OVRManager.audioOutId;
FMOD.System coreSystem;
FMOD.RESULT result = studioSystem.getCoreSystem(out coreSystem);
int driverCount = 0;
result = coreSystem.getNumDrivers(out driverCount);
for (int i = 0; i < driverCount; i++)
{
int rate;
int channels;
System.Guid guid;
FMOD.SPEAKERMODE mode;
result = coreSystem.getDriverInfo(i, out guid, out rate, out mode, out channels);
if (guid.ToString() == riftId)
{
result = coreSystem.setDriver(i);
break;
}
}
}
Understood, it looks like you are calling PreInitialize at the top of RuntimeManager.Initialize, at this point the Studio System won’t have been created yet. Try moving your call to PreInitialize down to just before the call to studioSystem.initialize, line 244 in the version I have here.
It worked. Thanks Mathew.
If someone has the same problem and needs to avoid upgrading to 2.1 for any reason, the snippet of code above should work. Just make sure you call this method after the “FMOD.Studio.System.create”.