[WebGL] Stuttering audio too problematic with FMOD

Unfortunately having integrated FMOD into a WebGL project for the last few months, we’re facing the hard decision to shift back to unity built in audio.

The primary driver for this is stuttering audio experienced in WebGL browser. Similar to some other users we have issues with scene loading boundaries, as well as occasional “during play” stutters. The during play stutters due to dropped frames are difficult to eliminate (an example of this is a large addressable which gets downloaded in the background and loaded into memory, spending ~60ms on lower end devices).

Some techniques help (e.g. ducking audio between loading) with a small impact on user experience, but during play, even the odd stutter or two is enough to negatively impact the sense of interaction in a way that is less noticeable with a visual frame drop. And eliminating all the individual causes of stutters is not a guarantee as we are also constrained by some of unity’s systems.

Is there anything on the FMOD configuration level that I can leverage to try to compensate? I tried playing with DSP buffer size, but still experience stutter, am I right in thinking the max acceptable latency at 2048 is effectively 40ms of a blocked frame?

Unfortunately I feel like moving away from FMOD to built in is the most likely scenario for us right now :frowning: I appreciate that FMOD is severely limited by browser capability.

Thanks,

Matt

1 Like

There are a few things you could try, but at the end of the day WebGL is a single-threaded environment with no access to the GPU and, as you mentioned, varying performance between browsers. Some things to try:

  • Never have more than one streaming asset playing at a time.
  • Preload banks/events before gameplay, and unload anything you don’t need.
  • Where possible, reduce the Max Instances count and use a relevant Voice Stealing option to compensate for dropouts.
  • Avoid convolution reverb.
  • Increase the DSP Buffer Length in the FMOD Unity settings for WebGL

40ms is the default for most platforms, with a DSP Buffer Length of 512 and DSP Buffer Count of 4. A DSP Buffer Length of 2048 and DSP Buffer Count of 4 would give you a 170ms of latency. Whether or not that is an acceptable amount of latency for your case is something to be determined with user testing.

Hi, I would love to know how this worked out. We are debating using FMOD for a WebGL Unity project. Would love to talk to anyone at FMOD or author of this post for any insight. thank you Mike