Audio Crackling on Android Web Export with Real-Time Audio Generation

Godot Version

4.4.1

Question

Hi everyone,

I’m building a game in Godot 4.4.1 that generates sound in real time using AudioStreamGenerator. The idea is to export it to the web so it runs in browsers — and it works perfectly on desktop (macOS, Linux, Windows) and even iOS.

However, I’m running into a consistent issue on Android devices: the audio (mp3 or real-time generated) crackles constantly.

I’ve tried a wide range of things, including:
Adjusting AudioStreamPlayer parameters (buffer length, volume, etc.)
Changing import settings for the audio
Modifying audio bus layout, disabling all effects
Increasing and decreasing sample generation rate
Pre-generating audio and streaming it
Testing across multiple Android devices and browsers (Chrome, Firefox, Samsung Internet)
Trying different sample rates and buffer sizes

But nothing seems to stop the crackling on Android web builds. I suspect it’s related to how audio is handled in WebAssembly/WebAudio on mobile browsers, possibly due to timing or buffer underruns — but I can’t pinpoint the exact cause or find a workaround that consistently works.

Has anyone else run into this?