I have a track in FMOD Studio. It has several layers. Here’s how it works: I have a track called Main Startup, a track called Extra Layer Startup, a track called Main Loop, and a track called Extra Layer Loop.
The track plays both Main Startup and Extra Layer Startup and the beginning, then move into Main Loop and Extra Layer Loop that both loop infinitely. They loop perfectly in FMOD and everything plays together.
However, as soon as these tracks are played in Unity (before even looping once) the tracks are slightly, but very obviously, out of sync with one another.
Does anyone know what the cause of this might be? It has happened with multiple tracks now and we can’t seem to figure out why it would sound great in FMOD and totally off in Unity.
- You must login to post comments
I’m not entirely sure what you mean by “track” and “layer” in this question, so please forgive me if I’ve misunderstood something, but it sounds like you’ve put sound modules on multiple different audio tracks of an FMOD Studio event, and they’re do not always starting in sync.
If that is the case, the issue most likely results from the way our scheduling system interacts with multiple simultaneous streams. By nature, streams buffer continuously, which allows them to play without waiting for their assets to completely load, but also means that the time between their being triggered and their actually starting to play can vary. Under normal circumstances, this slight variability is too small to detect, but when you have multiple streams starting at the same time while resources are constrained, it can become noticeable.
There are a number of possible workaround for this. The simplest to implement, but most expensive in terms of memory, is to not use streams for your music. Simply go into the Assets Browser, select the offending sound files, and click on the “STREAM” toggle button. This will set those files to load completely before any event that uses them begins to play, but will increase the memory requirements of that event.
As an alternative, you could bake the individual sound files as separate channels of a multi-channel sound file, and then use the FMOD Channel Mix effect module to separate them out onto different tracks in Studio. This would allow you to use a single stream that always remains in sync with itself, but may be inappropriate or difficult to implement if you’re using timeline logic – and it sounds like you are.
A third option would be to use the FMOD Studio programmer’s API set the scheduling delay of this specific event to be higher than its default. This will create a slight latency when playing the event, but will give the streams in that event a little longer to buffer, increasing the chance of their both being ready when the event starts to play. This may be the best option, but may require you to tweak the code a few times to find the right balance of speed and reliability.
Thanks for the response! This sounds like it might be the solution. I’m trying the stream method right now. There are actually a lot of tracks though (I tried to reduce the complexity of what I was talking about in the main post to avoid confusion), so I’m expecting to have to use one of the other methods.
I am using timeline logic (I believe) so it sounds like the 2nd method won’t work.
I’d like to try the last method you mentioned, but I’m really not sure how I would go about doing that. Would you be able to give me more information on how to implement that?
Also, here’s a video of what the project looks like, in case that might be helpful at all: https://vid.me/LIk6
For the third method, you’ll need to use Studio::EventInstance::setProperty to set the FMOD_STUDIO_EVENT_PROPERTY_SCHEDULE_DELAY property of the event. See http://www.fmod.org/docs/content/generated/FMOD_Studio_EventInstance_SetProperty.html and http://www.fmod.org/docs/content/generated/FMOD_STUDIO_EVENT_PROPERTY.html for details.
- You must login to post comments
Please login first to submit.