Unity deployment to HTML5/WebGl stuttering

Hey guys. Does anyone know how to set up FMOD in Unity for WebGl/Html platforms? I tried doing this a while ago and FMOD support said something about setting the DSP blocks from 4 to 2. They sent some sample code that has basically sent me down several rabbit holes of basic understanding of how everything works under the hood. I don’t mind spending some extra time connecting the dots, but I feel like it might be overkill for something that is close to a ‘set it and forget it’ situation.

This is part of the explanation and the sample code I received, but doing searches through the scripts has sent me down rabbit holes: Audio Stability (Stuttering)
Some devices cannot handle the default buffer size of 4 blocks of 1024 samples (4096 samples) without stuttering, so to avoid this set the buffer size in your application to 2 blocks of 2048. Here is an example

result = gSystem.setDSPBufferSize(2048, 2);

I’m looking for more of a step by step thing, like:

  1. Put this code in script whatever.cs on after line (random number)
  2. Go into the settings of (tab of software) and click this button
  3. Whatever Else
  4. You’re all set, all known HTML stuttering issues should be resolved


The docs for System::setDSPBufferSize state that it must be called before the System::init is called. So add it to the RuntimeManager.cs, in the Initialize function, after studioSystem.getCoreSystem/getLowLevelSystem and before studioSystem.initialize.

You can also find more information in our docs: