00:00
00:00
Newgrounds Background Image Theme

Someone gifted MetalSlayer69 supporter status!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Music not working on my game uploaded to Newgrounds

577 Views | 8 Replies
New Topic Respond to this Topic

I've been working on my own game for a bit now and decided to see if I could put it to here. I made a test HTML5 export of it and it runs normally and it seems that everything else works as intended except the background music. Does anyone know what would cause only the background music to not work on a game made in GDevelop 5? Every other (only 2 lol) sound effect work fine with a little delay at first but then plays like supposed to.


Does Newgrounds require to have a specific sound file format or does any file work? The music is a mp3 file btw.


Look at him spin

BBS Signature

Haven't worked with GDevelop5, but all modern browsers require a user interaction before playing any audio, so assuming that your game starts playing music before the player presses a key (or clicks anywhere) the music won't be allowed to play by the browser. Every sound after user interaction should be fine tho.


BBS Signature

Response to Music not working on my game uploaded to Newgrounds 2023-04-04 01:18:37


At 4/3/23 10:56 PM, RodDeLaPan wrote: Haven't worked with GDevelop5, but all modern browsers require a user interaction before playing any audio, so assuming that your game starts playing music before the player presses a key (or clicks anywhere) the music won't be allowed to play by the browser. Every sound after user interaction should be fine tho.


Well it doesn't work like that. It never starts to play the BGM for some reason but every other noise works


Look at him spin

BBS Signature

Response to Music not working on my game uploaded to Newgrounds 2023-04-04 02:02:05


At 4/4/23 01:18 AM, aapiarts wrote:
At 4/3/23 10:56 PM, RodDeLaPan wrote: Haven't worked with GDevelop5, but all modern browsers require a user interaction before playing any audio, so assuming that your game starts playing music before the player presses a key (or clicks anywhere) the music won't be allowed to play by the browser. Every sound after user interaction should be fine tho.
Well it doesn't work like that. It never starts to play the BGM for some reason but every other noise works


As I said I'm not familiar with GDevelop5, sorry if I can't help you any further. But (almost) every time this kind of thing happen on HTML5 is because of the Autoplay Policy as far as I know.


BBS Signature

Response to Music not working on my game uploaded to Newgrounds 2023-04-04 02:21:57


At 4/4/23 02:02 AM, RodDeLaPan wrote:
At 4/4/23 01:18 AM, aapiarts wrote:
At 4/3/23 10:56 PM, RodDeLaPan wrote: Haven't worked with GDevelop5, but all modern browsers require a user interaction before playing any audio, so assuming that your game starts playing music before the player presses a key (or clicks anywhere) the music won't be allowed to play by the browser. Every sound after user interaction should be fine tho.
Well it doesn't work like that. It never starts to play the BGM for some reason but every other noise works
As I said I'm not familiar with GDevelop5, sorry if I can't help you any further. But (almost) every time this kind of thing happen on HTML5 is because of the Autoplay Policy as far as I know.


Damn. Maybe the GDevelop forum can help with it more. I mean the engine is made to work on NG so maybe I'm just missing some odd button or something


Look at him spin

BBS Signature

Response to Music not working on my game uploaded to Newgrounds 2023-04-04 10:00:31


Aside from the audio tips from the GDeveop Wiki, for an HTML5 export I'd also suggest 1) seeing if it's browser dependent or doesn't work on any browser at all, 2) most browsers you can open their menu and look for something like Developer Tools (often tied to hotkey Ctrl-Shift-I) which should open a window including a Console tab which will show errors that might give you a clue what's going on, 3) just try replacing the .mp3 with an .ogg (convert it with something like Audacity) and see if it magically fixes things.


My newsfeed has random GameDev tips & tricks

Response to Music not working on my game uploaded to Newgrounds 2023-04-04 12:53:35


At 4/4/23 10:00 AM, 3p0ch wrote: Aside from the audio tips from the GDeveop Wiki, for an HTML5 export I'd also suggest 1) seeing if it's browser dependent or doesn't work on any browser at all, 2) most browsers you can open their menu and look for something like Developer Tools (often tied to hotkey Ctrl-Shift-I) which should open a window including a Console tab which will show errors that might give you a clue what's going on, 3) just try replacing the .mp3 with an .ogg (convert it with something like Audacity) and see if it magically fixes things.


Yeah I was thinking about trying that last one when I have time. Gonna give those others a go too


Look at him spin

BBS Signature

Response to Music not working on my game uploaded to Newgrounds 2023-04-04 17:57:34


After some more testing it seems that the music starts to only play if you click the game window while it's loading it. Doesn't work when you are in the actual game. I might have an idea for a solution for it


Look at him spin

BBS Signature

Response to Music not working on my game uploaded to Newgrounds 2023-04-04 18:15:24


At 4/4/23 05:57 PM, aapiarts wrote: After some more testing it seems that the music starts to only play if you click the game window while it's loading it. Doesn't work when you are in the actual game. I might have an idea for a solution for it


Yup my idea worked. I simply needed to make a "left click here to play the game" type of screen at the beginning


Look at him spin

BBS Signature