Easiest way to disable FMOD for debugging?

When we try to debug something, a lot of the times I feel it would be super helpful to be able to disable FMOD-> check if the problem still happens → determine if it is an audio issue. What would be the best way to do so?

Hi,

To clarify, do you want to disable the integration’s FMOD system, disable the entire plugin, or simply set it to output no sound?

Disable the integration’s FMOD system. Ideally we want to have a setting so that no FMOD update happens under this mode.

The easiest way to do this would be to modify two lines in ./FMODStudio/Source/FMODStudio/Private/FMODStudioModule.cpp:

  • Edit line 246 to always return false, so that FMOD is never “using sound”: virtual bool UseSound() override { return false; }
  • Comment out line 575, so that FMOD always returns before creating a system: //if (!bUseSound)

This essentially achieves the same outcome as running the project as a dedicated server - the FMOD Studio system is never created in the first place. I’ve taken the liberty of adding this to our internal feature/improvement tracker as well, as while it is a simple change, changing these lines each time you want to test your game without an FMOD system running is a bit unwieldy.

If you run into any issues, feel free to let me know.

Thank you!! What is line 575 ? We have some small edits here and there in the file so it might not match the original FMODStudioModule.cpp

Edit: nvm got it!

Thanks!

1 Like

Line 575 is the second line of FFMODStudioModule::CreateStudioSystem, and comes just after DestroyStudioSystem(Type); Here’s a code snippet:

void FFMODStudioModule::CreateStudioSystem(EFMODSystemContext::Type Type)
{
    DestroyStudioSystem(Type);
    if (!bUseSound)    // <- comment out this check, so the function always hits return
    {
        return;
    }

    UE_LOG(LogFMOD, Verbose, TEXT("CreateStudioSystem for context %s"), FMODSystemContextNames[Type]);

    // rest of the function below here...
}
2 Likes