On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Audio stutter in HTML5 build

A topic by nickadance created Sep 05, 2021 Views: 1,635 Replies: 7
Viewing posts 1 to 4
Submitted (1 edit) (+2)

Hi, does anyone else experience crackling audio in their HTML5 builds?

I checked using Chrome, Edge and Opera, using either GLES2 or GLES3. Also tried increasing the audio output latency in the project settings. Nothing worked.

Edit - I'm building on Windows 10 x64 using v3.3.3.stable.mono.official

Submitted

yea, that happens with mine sometimes too, especially when the game is loading a new level

unfortunately nothing much i could do about it :(

Submitted

I had that problem before.

Submitted(+1)

Yes -- the best way to fix this is to never load any scenes. Make your entire Godot game a single scene, and load all of your assets/scenes up front. This is the approach I took for my submission "Frog Finder", to work within the limitations of Godot and HTML5.

An alternative approach to fixing this is to fade out/fade in your audio during scene transitions or when you need to load new resources. This is better for bigger games where you need to load large levels or where it's infeasible to have the entire game in a single scene.

It is frustrating :(

Submitted

oh, that's interesting, i never knew that worked

very cool! thanks for sharing :)

Submitted(+1)

Interesting, I'll keep that in mind!

My submission is super simple, single scene, the only scripting is around player movement, but the music track keeps crackling/stuttering even on high spec hardware - so I'm not sure if my issue is related to loading :(

Submitted

If you are ever doing anything like `load("res://EnemyScene.tscn")` where you are loading a sound effect, scene, or script at runtime -- that might cause it. I'd try to cut down on runtime loading of stuff, and `preload` where possible, or spawn nodes when your game starts and then switch them visible/invisible.

Unfortunately I'm not 100% sure what causes these issues -- for me, it just seems to occur during scene transitions or when a lot of things are loaded. I'm sorry.

Submitted (3 edits) (+2)

Guys, did you try enabling multithreaded html5 export? By default, it one thread, it may be that audio cant refill buffer when game does large delay spikes (loading a big chunk of something). 

I didn't tried this yet, my games usually one scenes. But I'm interested in resolving this issue.

Be notified: multithreaded html5 build can work on smaller set of modern browsers, please check docs.