Delay on sound play & stop

Hello folks,
I am having an issue with fmod sound instances being delayed, both when starting and stopping. I have browsed other discussions here regarding sound delay, but haven’t had any advice form there work out. The delay is only on Unity, and what’s most surprising is that it occurs both when trying to start playing a sound instance, and when trying to stop it. The problem occurs whether I create a sound instance or play it as one shot.

Below is a C# code snippet from my sound manager that handles all the sound start and stopping

    public void PlayAtSourceOverwrite(EventReference sound){
        soundInstance.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);
        soundInstance = RuntimeManager.CreateInstance(sound);
        soundInstance.set3DAttributes(RuntimeUtils.To3DAttributes(transform.position));
        soundInstance.start();
        soundInstance.release();
    }
    
    public void StopCurrentInstance(){
        soundInstance.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);
    }

(I also have a short video demonstrating the issue, but can’t upload as a new user :/)

One thought I had was that there is a distance between the fmod listener (attached to the camera) and the SoundManager, but even when putting them at the same position or setting the attenuation object in the listener as the SoundManager didn’t have any results.

Unity version is 2022.3.46f1, fmod version is 2.02.25.
Thank you!

1 Like

Hi,

Thank you for the information. Are there any FMOD logs in the console? If you apply the following settings:


The Load Bank Sample Data will also aid in reducing latency whenever an event is played for the first time: Unity Integration | Settings - Load Bank Sample Data.

Hey there,
thanks for replying! I have now found the error, as a matter of fact it was in the samples, as they all had a slight latency to them universally (and didn’t notice until they were played in-game and had to double-check the fmod events). Still, making sure that the bank data is loaded beforehand is very helpful, so thanks!

1 Like

Thank you for sharing the solution!