Layers going out of sync

Hello everyone,

I’m using FMOD Studio to play music tracks during gameplay. Each event has many layers which are switched on and off according to a parameter that is dinamically changing in real time. Problem is when the game starts (I’m working in UE4) the layers play out of sync (some of them start with a delay) and they continue like that until there’s a transition marker (after jumping to the new marker they are synched).

I tried to use the Stream function and that solved the problem for the beginning of the music but I discovered that instead the layers were going out synch when switched on and off according to the parameter (probably because FMOD is doing an async preload).

So I have two approaches, both with synch problems. Is there a way to prevent this?

Thanks,

Aram

For sample data, you can make sure the event has sample data loaded by one of a few ways:

  • Enable “load all sample data” in the UE4 settings which will load all the sample data at startup.
  • Call the blueprint functions LoadBankSampleData or LoadEventSampleData ahead of time to ensure the sample data is loaded.
  • Sample data will also load when instances are created so just having ambient sounds of the same type in existance will trigger the load.

If the sample data isn’t fully loaded then it is possible some sounds will have a slight delay which is what you are probably seeing.

For the stream case, it is difficult to guarantee that all streams play in sync since it depends on external hardware. We have an extra schedule delay that is applied for streaming events in that case, but if there are many tracks, then there can be lots of data that needs to be streamed in.

There is no exposed UE4 method of tweaking the schedule delay for streaming sounds, although for programmers there is an advanced API function EventInstance::setProperty with FMOD_STUDIO_EVENT_PROPERTY_SCHEDULE_DELAY that can be used.

Another method guaranteeing that multiple streams stays in sync is to bake them into a multichannel wav and use the Channel Mix effect. This effect can mix down multiple baked in tracks to a single mono or stereo pair, with a customizable gain.

For example, if you have 3 stereo pairs you can bake them into a 6 channel sound and then use the Channel Mix effect set to “Stereo” to mix them down as 3 pairs, and automate the 3 volumes for how they are mixed together. This is a manual process but it does guarantee that the streams will stay in sync in 100% of cases.

3 Likes