Guidance needed on Unity Timeline tracks that can play FMOD events

We’re creating a game in Unity that uses custom Timeline tracks to play cutscenes that include spoken and written dialogue. Our “Dialogue” data structures also include FMOD events that play the actual dialogue audio, so we can’t use the built-in FMOD Timeline integration without duplicating a fair bit of work when setting up our playable sequences.

Right now we’re running into a few issues and I’m hoping I can get some guidance on two in particular.

  • We can’t seem to play Timelines outside of play mode in Unity. This makes it difficult to lay out our Timelines and preview them.
  • We also can’t seem to set the clip length to match the length of the FMOD event, so while the start of the clip starts the FMOD event, it’s hard to know when the event will stop playing just based on the Timeline track because the end of the clip doesn’t actually match the end time of the event.

Additionally, it would be nice to see waveform previews of the FMOD events in the clip, but that’s not a requirement.

What’s the best way to approach these problems? Is there example code out there that we can follow? Any help is greatly appreciated, thank you!

Can you tell me which versions of FMOD and Unity you are using?

We can’t seem to play Timelines outside of play mode in Unity. This makes it difficult to lay out our Timelines and preview them.

Do you mean that by pressing play in the Timeline editor window you aren’t able to hear any FMOD audio?

We also can’t seem to set the clip length to match the length of the FMOD event, so while the start of the clip starts the FMOD event, it’s hard to know when the event will stop playing just based on the Timeline track because the end of the clip doesn’t actually match the end time of the event.

This is tricky, as an FMOD event does not necessarily play from left to right on the timeline. You can have looping regions, transitions, sustain points, and even audio inside a parameter sheet instead/as well as on the timeline.

We’re using Unity 2023.2.5f1 and FMOD 2.02.19

Using FMOD’s built-in Timeline track type we can hear FMOD audio, but when using our own custom data structure and track type, we can only hear FMOD events in play mode.

Recently we did make the decision to start using Audio Tables and programmer sounds for our dialogue. Is there a way to use ATs to get the length of a sound and make it match the clip length on Timeline?

You can compare the way that we control our own playables behavior in FMODEventPlayable.cs, inside the OnEnter function in particular.

You are able to do this once you have created a sound from an AudioTable, eg. shown in the programmer sound example, you are able to then call Sound::getLength which could also be done ahead of time (instead of inside the CREATE_PROGRAMMER_SOUND callback).