Some question about studio and sample

I’m trying to integrate FMOD with Godot, but I’m not very clear on how the engine works.

  1. As I understand it, Studio API commands are only actually processed when Studio::System::update() is called.
    If I callupdate()before making other Studio API calls, will those API calls be deferred until the next update?

  2. I want to align the beats between two audio samples as precisely as possible.
    Currently, I start one event first, then start the second one using a timeline beat callback. However, I noticed that the callback is only processed during update(), which introduces some latency.
    Is there a better way to schedule playback at a precise position?

  3. I’m aiming for sample-accurate synchronization. How does setDelay work? If it allows pre-scheduling or pre-mixing audio data, that would be ideal.

  1. An exert from: FMOD Engine | Studio Api System - Studio::System::Update
    When Studio is initialized in the default asynchronous processing mode this function submits all buffered commands for execution on the Studio Update thread for asynchronous processing. This is a fast operation since the commands are not processed on the calling thread. When Studio is initialized with FMOD_STUDIO_INIT_SYNCHRONOUS_UPDATE queued commands will be processed immediately when calling this function.

    So it will depend on how you initialize the FMOD system.

  2. A potential solution could be using the FMOD_STUDIO_INIT_SYNCHRONOUS_UPDATE flag.

  3. FMOD Engine | Core Api Channelcontrol - Channelcontrol::Setdelay is used for exactly that. However, it does require accessing the FMOD Engine | Core Api. Our FMOD Engine API install includes and example of how to use setDelay(): C:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\core\examples\gapless_playback.cpp.
    To improve playback times you can also use:
    FMOD Engine | Studio Api Bank - Studio::Bank ::Loadsampledata
    FMOD Engine | Studio Api Eventdescription - Studio::Eventdescription::Loadsampledata

Hope this helps!

I should look the documentation carefully. The example is useful, thanks.