We’re having problems with fmod using the correct audio output device with VR. A lot of times the headset connects after the start of the application, including in the editor.
fmod seems to not handle this at all, unlike the rest of the Unity audio, which works fine.
Is this as designed? I ask because it’s a big pain for VR, and it’d really be nice if it auto-switched like Unity.
What’s the suggested way to handle switching output devices?
After some more testing, I’ve concluded that it doesn’t matter if you start the Oculus app and connect the headset first, before running the Unity editor. It seems like there’s some device hand-off that happens later anyway.
Any suggestions on how to set up an output device switch? Or is this a bug?
Thanks for the info! If the system default output device switches while the app is running, does it update? If so, there seems to be a bug because it doesn’t update when the device switches.
Hello, is there any news regarding this issue? I am also working on a VR proyect and it’s something really important for VR, both Oculus and SteamVR change the windows audio output to the headset when launching the game, and currently if you launch the game directly from Steam before opening SteamVR for example, the windows audio output is changed after the game finished launching so fmod ends up with the last output windows had.
Hi guys.
I’m in the same position, trying to set Oculus as my main audio device (they demand it to publish with them).
Where should we use the getNumDrivers, getDriverInfo & setDriver?
Right now we are putting some of this code on the “FMOD.RESULT Initialize()” inside of the RuntimeManager but we are experimenting some errors.
Ty
Hi, I’m trying to use FMOD while developing a hololens 2 project in unity. I have 2 audios and I want to play them through 2 different output speakers. One from the hololens speaker and the other through my laptop speakers. So I tried: ```
private void SetAudioOutputToHoloLens()
{
int numDrivers = 0;
fmodSystem.getNumDrivers(out numDrivers);
// Check if there are available devices
if (numDrivers > 0)
{
string hololensDeviceName = "Speakers (Mixed Reality Audio Driver)";
for (int i = 0; i < numDrivers; i++)
{
string driverName;
int driverNameLength = 256;
System.Guid guid;
int systemRate;
SPEAKERMODE speakerMode;
int speakerModeChannels;
// Get driver info for the current device
fmodSystem.getDriverInfo(i, out driverName, driverNameLength, out guid, out systemRate, out speakerMode, out speakerModeChannels);
// Log the driver name for debugging purposes
UnityEngine.Debug.Log("Driver " + i + ": " + driverName);
if (driverName == hololensDeviceName)
{
// Set this driver as the output device for FMOD
fmodSystem.setDriver(i);
UnityEngine.Debug.Log("Set audio output to HoloLens device.");
break;
}
}
}
else
{
UnityEngine.Debug.LogError("No audio devices found.");
}
}
However, neither the laptop speakers nor the hololens speakers show up in the driver list. I’m not sure why. Can you please help?
The laptop speakers are on the OS driver list (Speakers Realtek(R) Audio) but the HoloLens is being used by the Holographic Remoting connection (wireless), so the HoloLens speakers aren’t in the list.
However, the laptop speakers still don’t show on the driver list.
That’s what I was using in the code (fmodSystem.getDriverInfo(i, out driverName, driverNameLength, out guid, out systemRate, out speakerMode, out speakerModeChannels);). It didn’t give me any errors but it also did not show the speakers.