How do I avoid this error when sound loops?

Get help using Construct 2

Post » Mon Jul 13, 2015 3:26 am

At the end of the song and when music restarts (I have looping music) this error appears, I've tried everything but keeps appearing.
I've tried to stop all sounds, silent the sound, check if sounds play with a variable and then stop and start the sound, nothing works.

Javascript error!
Uncaught invalidstate error: failed to execute 'creativemediaelementsource' on "Audiocontext": HTMLmediaelement already connected previously to a different Mediaelementsourcenode.
http;//localhost:50000/Audio_plugin.js, line 1082 (col 64) This is either a bug in Construct 2 or a problem in a third party plugin or behavior - please report it to the developer

I've tried to remove the error changing all the code, and this level 1 only plays a single sound file, the music, but I want it looping. I can't just play it once and leave the level without music, that could solve the problem though. Or, I could edit the file to make it much bigger to repeat the music in the sound file but that will be very big and make my game much bigger in size. Or, I can remove the music at all. But I really hope to be able to have some music in my game.
Maybe i just don't know how to add it correctly?

first I added a line that says stop all sounds when layout starts.

Then I just added the events: "on start of layout ( plus another condition: music is not playing ) then --> play "music" looping at volume -10db (tag "music")

I'd appreciate any help.
B
3
Posts: 10
Reputation: 197

Post » Mon Jul 13, 2015 7:48 am

I found a fix for this, maybe temporary but works for me.
If I move the sound files to the "sounds" folder instead of the "music" folder, it gives no more errors!
B
3
Posts: 10
Reputation: 197


Return to How do I....?

Who is online

Users browsing this forum: 25games, Artcadev and 21 guests