Page 1 of 2

Music not playing at beginning of scene. Please help!

PostPosted: Tue 8 Jan 2019, 21:40
by Shadowbonnie7
Okay, so I started working on a game, and made a test room to test the character. I also put music in this scene.
However, I did this on an earlier version (Maybe GD5 V54). When I decided to upgrade to the latest version (GD5 V61 as of now), the music suddenly does not work when the scene loads.
My code is:
"At the Beginning of the Scene: Play Music on a Channel." (That is all that there is)
Unfortunately, it doesn't work anymore!
Even more strange, when I open the debugger and pause the preview, the music DOES play. When I unpause the scene, the music stops! I want it to do the opposite!
I also tried this with a different music track. Same results... :(
I have no idea why it does this. Is this a bug that was introduced in GD5 V61, or am I just a moron who is clearly doing something wrong?
Any help is appreciated. Thanks.

Re: Music not playing at beginning of scene. Please help!

PostPosted: Fri 11 Jan 2019, 20:15
by Shadowbonnie7
Anybody? Please?? :cry:

Re: Music not playing at beginning of scene. Please help!

PostPosted: Fri 11 Jan 2019, 20:37
by ddabrahim
I can not reproduce it, music play fine at the beginning of the scene here :?
Opened an old project in v61 and works for me.

Did you try to create a new empty project where the ONLY thing you do is play a music at the beginning?
I would recommend to try it and if it doesn't work, post it here with a free music from the internet so we can have a look.

Re: Music not playing at beginning of scene. Please help!

PostPosted: Mon 14 Jan 2019, 20:38
by Shadowbonnie7
Thank you for your reply mate. :D
Now, I did what you said. I made a new project, and put absolutely no events other that one one that plays the music. Strangely, it doesn't play. Here is the file. Am I doing something incorrectly?? Thanks in advance.

Edit: Um, can you help me quick? The website is not letting me upload the file...

Re: Music not playing at beginning of scene. Please help!

PostPosted: Mon 14 Jan 2019, 21:13
by ddabrahim
Can't you upload it to a file sharing platform then?
Like this:
https://uploadfiles.io/

Or Google Drive, DropBox, OneDrive..etc and share a link to download here.

Not sure why it doesn't let you upload it. I think there is a size limit, in case the music is huge, include something smaller it doesn't need to be long. Or just share your project file and then I can drop something in...

Re: Music not playing at beginning of scene. Please help!

PostPosted: Mon 14 Jan 2019, 21:26
by Shadowbonnie7
Should I post the file in the link you provided? Otherwise, I can try Google Drive.

Re: Music not playing at beginning of scene. Please help!

PostPosted: Tue 15 Jan 2019, 20:37
by Shadowbonnie7
I have uploaded the file online. It can be found here: https://ufile.io/7ws4s
The music isn't mine BTW, it is Nintendo's from SMO. I'm just using it for testing.

Also, I upgraded to version 62 recently. Same results.

Re: Music not playing at beginning of scene. Please help!

PostPosted: Tue 15 Jan 2019, 20:47
by Lizard-13
By chance it works if instead the action to play music you use the action to play sound?

If so it's a very tricky bug that I haven't been able to catch, and totally forgot it, can you add an issue on GitHub please?, if you add the example there, better, also information like the browser and OS is useful :)

Re: Music not playing at beginning of scene. Please help!

PostPosted: Tue 15 Jan 2019, 21:00
by ddabrahim
Actually the problem is, in HTML5 audio is not allowed to play (not sure why) before the user interact with the page.
If you click the game window, the music starts playing.
Not sure if it's a bug. I believe browsers do this by purpose because of the ads maybe or security reasons?

Anyway, to work around, always make sure the user does interact with the screen when the game starts like add a play button that needs to be clicked or something in one scene and then go to the next scene where the music is going to start playing.

Re: Music not playing at beginning of scene. Please help!

PostPosted: Tue 15 Jan 2019, 21:31
by Shadowbonnie7
Lizard-13 wrote:By chance it works if instead the action to play music you use the action to play sound?

If so it's a very tricky bug that I haven't been able to catch, and totally forgot it, can you add an issue on GitHub please?, if you add the example there, better, also information like the browser and OS is useful :)


You know, in the latest version of GDevelop (V62) there is a new example called "Music on Mobile" that says that the music has to be played as a sound instead of a music file. I'm not making a mobile game, but sounds work just fine. I think this could actually work in the meantime before the bug is fixed! Thanks mate!

I also reported the bug on Github if that helps.