Can you use Get Parameter to get the current Timeline value of an FMODAudio component?

Hello!

I’m currently working on a music game in UE4 and thus have somewhat unusual needs for audio synchronization between Fmod and my game logic. In particular, I need to be able to tell whether or not a player’s button input is on tempo or not.

The ideal way to do this seems to be to use the Timeline parameter in Fmod to tell where playback currently is whenever the player hits the button. Once I’ve added a tempo marker to my logic track everything gets broken into nice beats and measures, which seems perfect, except that when I try to use the Get Parameter node in a Blueprint to get the Timeline parameter it always returns 0 as a result.

Is it not possible to access the current value of the Timeline in this manner? I realize that actually setting the Timeline parameter isn’t a valid behavior (and I’m not trying to do that!) but getting its current value seems quite useful in a situation such as this. If this isn’t possible, is there another route to getting this information from Fmod?

Sorry for the somewhat complex question but I hope this is clear. Thank you very much for your time!

Hi Norman,
Timelines won’t be found as parameters.

It is fairly simple to add timeline get/set functions that are exposed to blueprints though, it is just a matter of wrapping the FMOD Studio API functions EventInstance::getTimelinePosition and EventInstance::setTimelinePosition, probably converting them to float seconds as they are called.

I have created a task into our backlog for adding that feature into our wrapper. If you really need it before then, you could always change the wrapper with this new function:

float UFMODAudioComponent::GetTimelinePosition()
{
int TimeMs = 0;
if (StudioInstance)
{
	FMOD_RESULT Result = StudioInstance->getTimelinePosition(&TimeMs);
	if (Result != FMOD_OK)
	{
		UE_LOG(LogFMOD, Warning, TEXT("Failed to get timeline position"));
	}
}
return TimeMs / 1000.0f;
}

GetTimelinePosition and SetTimelinePosition have now been added to the audio component. They will be available next release.