Sound won't switch to new device

I don’t know if this is a FMOD issue or not, but I don’t know where else to look.

Once my game starts, if I switch to headphones, or some other source, the audio continues to come out the original source until I quit and restart the game.

I am running on a Mac (Mojave).

Anyone have any info on why audio in the game doesn’t switch to a new source without a restart?

Device changes aren’t handled automatically. You should be able to use the FMOD_OUTPUT_DEVICELISTCHANGED_CALLBACK callback to detect when a new device is detected (eg. a headphone is connected) and use game code to automatically switch to that device.

https://www.fmod.com/resources/documentation-api?version=2.1&page=plugin-api-output.html#fmod_output_devicelistchanged_callback

It’s interesting to hear that Macs will output to the speaker and headphone separately.

Not sure I know what that means? Do I need to reinit FMOD? FMOD_Studio_System_Initialize()?

That is the only thing I do to start audio in my game.

After speaking with the dev team, it seems that FMOD should be switching to the default audio device when it’s plugged in. Let us try to run a few tests on our end and we’ll get back to you.

Thanks.

From our tests on a few different Mac machines, it seems that FMOD does indeed switch automatically when a new device (ie. headphones) is plugged in. This happens in both the FMOD Studio application and in an in-game setting.

Does this happen on any other Mac? Are you seeing any errors appearing in the console of the FMOD Studio application or game?

I am using bluetooth headphone (I don’t have any others) and if I start the game, audio comes out the speakers, I open up System Prefs and change the audio to my earbuds and I hear the Mac chime, but the game (FMOD) audio continues out the Speaker. If I close the restart the game, audio is fine.

This also happens for our testers.

The same is true for FMOD studio, so it’s not just my game. There are no errors in the FMOD Console.

I can now confirm that this same behaviour is happening on our machines too. Uncertain of the reason for this - it looks like whatever the Mac OS is doing to switch its default output to Bluetooth is not the same logic for any other device (headphone jack, USB interface, etc.). We’ll investigate this further and see what’s going on.

In the meantime, I’ve mentioned before that FMOD provides a callback for when a new device is detected. You can utilize this callback to offer to or automatically change to the new device when detected.

Thanks for looking into this. I am still confused as to what I need to to after getting the FMOD_OUTPUT_DEVICELISTCHANGED_CALLBACK? How do I switch to this new device? Or is this a OS X level call I need to make?

Oh sorry, my mistake, I should have mentioned.

Once you have received the device change callback, you can then use the Core API function System::setOutput to choose this new device, or System::setDriver for macOS.