Hello everyone !
I think I’ve encountered a bug if FMOD.System when changing the default device on Windows when setCallback is used to handle FMOD.SYSTEM_CALLBACK_TYPE.DEVICELISTCHANGED.
Our setup in Unity lets users choose on which device they want the sound to be output to.
Let’s say they chose “system default” which means the device we want to output to will always be the first one in the drivers list.
The drivers list initially looks like this:
- 0: DEVICE A
- 1: DEVICE B
- 2: DEVICE C
The user then changes the default device from DEVICE A to DEVICE C through the Windows OS UI.
Once the system callback is called with type=DEVICELISTCHANGED, the drivers list now looks like this.
- 0: DEVICE C
- 1: DEVICE A
- 2: DEVICE B
After the callback is called, I enumerate the drivers with getNumDrivers and getDriverInfo and the list is as expected: the first driver is the new default device (DEVICE C).
FMOD still outputs sounds on the previous device (DEVICE A) which is expected since I didn’t do anything to change the output device yet.
But getDriver doesn’t return the new index of DEVICE A (which should be 1 in this example), it continues to return 0.
The only way I could find to have getDriver return the correct value is to call setOutput(None) and setOutput(whatever the previous value was). But this is not ideal since it cuts off the sound every time something happens with the device configuration.
I hope someone can have a look at this and check if it is indeed a bug or if I’m missing something regarding custom device handling.
Thanks in advance.
PS: we’re using version 2.01.10