Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

HTML build does not have music

A topic by KeMarcY created Feb 05, 2023 Views: 97 Replies: 3
Viewing posts 1 to 4
Submitted

I uploaded the game to liluo.io and to itch as EXE and HTML. But the HTML build does not have music, only the sound effects. And I know I just have to change the music to sound, but still, I'm interested why is this? Now I'm not able to fix this, but I hope nobody will play the HTML build and miss the cool music.

Well, enjoy Separaliens and all the other wonderful games others made :D Glad I could join!

Submitted

You should be able to play the music using the " Play a sound on a channel" in the actions. Once you do that simply Publish the HTML again and then compress the folder as a zip and reupload back to ITCH.

Submitted

That's odd. I've never had that happen before. I was told on the Discord forum the "play music" command is a legacy command and it is better to use play sound even for music (since you can loop them), but I never had the music command not play. Is the music file still in the game folder? I sometimes deleted important things by accident when getting rid of extra assets. If you have Discord, I find the GDevelop server has been a really good place to get answers to these types of questions. 

https://discord.com/invite/GDevelop

Submitted

Coming to this perhaps too late to be helpful for your jam project, but I think I know how you can avoid the issue in future.

Modern web browsers tend not to allow sound/video to autoplay before the user has interacted with the page. This is intended to prevent companies throwing out annoying ads that basically yell "BUY OUR THING!!!" the moment a page loads, but is a bit of a nuisance for HTML games where the "page" is something the user has specifically opened up to play. The easiest way around it is to make the player click something (perhaps a pre-title/menu "play" button) just to get things going. I had a look at Separaliens on gd.games and I can actually start the menu screen music just by clicking any area that's not a button.

Basically, it seems as though your setup is 100% okay already. The only reason it's not working as expected is the browser's autoplay-blocking behaviour, which is pretty trivial to avoid once you know about it.