How to use System->setParameterByNameWithLabel

,

Hello, we have a string parameter (label) in our project on FMOD side, I need to update it on C++ side in Unreal.

The function that I have been using so far supports only float arguments:
UFMODBlueprintStatics::SetGlobalParameterByName(FName Name, float Value)

I looked inside FMOD source code, and saw two cases where setParameterByNameWithLabel API is provided.

  1. Instances
  2. System

Problem with instances in our case is that in order to set parameter, i need to play instance to get its pointer. If I play the instance, it will start playing via previous incorrect parameter. I want to be able to update param first and then play the sound. That’s why not completely sure about the instance approach.

About system, I have no idea how to use it in C++. I was only using:
SetGlobalParameterByName and UFMODBlueprintStatics::PlayEvent functions.

Any help would be greatly appreciated : )

Couldn’t find any good code snippets on how to init system and use it

For anybody interested, you can use following snippet:

FMOD::Studio::System* StudioSystem = IFMODStudioModule::Get().GetStudioSystem(EFMODSystemContext::Runtime);
	if (StudioSystem != nullptr)
	{
		FMOD_RESULT Result = StudioSystem->setParameterByNameWithLabel("Footstep_Material", Param);
		if (Result != FMOD_OK)
		{
			UE_LOG(LogTemp, Warning, TEXT("SetFootstepParam(): Failed to set audio parameter, %d"),(int)Result);
		}
	}