Unity setDriver not working

Hi
I’ve multiple audio outputs (drivers) on my windows PC. I’m trying to change the output driver in runtime.
I’m using the setDriver method, it shows result as “OK” but nothing changes, audio still goes through default device.
Here’ the C# code:

FMOD.Studio.System.create(out var mainSystem);
mainSystem.getCoreSystem(out CoreSystem);

CoreSystem.getNumDrivers(out int numDrivers);
for (int i = 0; i < numDrivers; i++)
{
var d = CoreSystem.getDriverInfo(i, out string name, 100, out var guid, out int systemRate, out var spearkerMode, out int speakerModeChannels);
print($"{i} - {name} - {systemRate} - {spearkerMode} - {speakerModeChannels}");
}

var res = CoreSystem.setDriver(3);
print($“Change Result: {res}”);

What am I doing wrong?
I’ve tried following versionss:
FMOD - 20108, 20107
Unity - 2020.3.3f1, 2019.4.22f1

Ok found the solution,
all I had to do was, instead of creating the coreSystem, use like this.

var res = FMODUnity.RuntimeManager.CoreSystem.setDriver(3);
print($“Change Result: {res}”);

WORKS NOW!!!

2 Likes