FMOD Audio Stuttering on First Play (Unity WebGL)

Some Unity demos may exhibit audio stuttering or crackling, especially during the first few seconds of gameplay or the first time audio events are triggered. This is a common issue when porting to WebGL, and is typically caused by an FMOD DSP buffer configuration that is not ideal for browsers.

Symptons

You may notice:

  • Audio stutter during the first gameplay moments
  • Crackling when music starts
  • Glitches when multiple sound events trigger at once
  • Issue improves after playing for a while

This is not a spawnd-specific problem, it is a known WebGL runtime constraint and is usually fixed with a simple FMOD setting adjustment.

Fix: Configure FMOD DSP Buffer for WebGL

FMOD’s default platform settings are often tuned for desktop builds, not browser execution. To prevent stuttering, you should create a dedicated WebGL platform profile inside FMOD and adjust the DSP buffer size.

Step-by-step (Unity)

  1. Open Unity
  2. Go to: Edit → Project Settings → FMOD Settings
  3. Scroll to Platform Specific
  4. Duplicate the Default platform settings and create a new target platform called: WebGL
  5. Select the new WebGL platform profile
  6. Under DSP Buffer Settings, set:
    1. DSP Buffer Length: 2048
    2. (Leave Buffer Count as default unless you have special needs)
    3. ⚠️ Buffer length should always be a power of 2.
      1. Recommended values:
        1. 1024 - Lower latency, may still stutter 2048 - Best balance, usually fixes the issue 4096 - Very safe, slightly higher latency

Below is where this setting lives in Unity:

(FMOD Settings → Platform Specific → WebGL → DSP Buffer Length)

Why This Happens

Browsers impose stricter timing and scheduling constraints than native platforms. WebGL audio threads are more sensitive to buffer underruns, especially during initial asset loading or first-time event playback. Increasing the DSP buffer gives FMOD more room to stream audio smoothly.

Recommendation Summary

All demos using FMOD should:

  • Add a dedicated WebGL platform profile
  • Set DSP Buffer Length to 2048
  • Test first-play audio behavior before submission

This avoids a poor first impression for players trying the demo on web!